package com.yellowpage.ndc.action;
  
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.zip.ZipEntry;
import java.util.zip.ZipOutputStream;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.poi.hssf.usermodel.HSSFRow;
import org.apache.poi.hssf.usermodel.HSSFSheet;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.struts2.ServletActionContext;

import com.yellowpage.white.common.Configuration;
import com.yellowpage.white.common.Constants;
import com.yellowpage.white.common.PageRender;
import com.yellowpage.white.struts.BaseAction;
import com.yellowpage.white.struts.Module;
import com.yellowpage.white.struts.OperationType;
import com.yellowpage.white.util.Util4Java;

import com.yellowpage.ndc.data.Address;
import com.yellowpage.ndc.data.ManageRegion;
import com.yellowpage.ndc.data.ProdClass;
import com.yellowpage.ndc.data.ProdCustomer;
import com.yellowpage.ndc.data.ProdGroup;
import com.yellowpage.ndc.service.AddressService;
import com.yellowpage.ndc.service.ManageRegionService;
import com.yellowpage.ndc.service.ProdClassService;
import com.yellowpage.ndc.service.ProdCustomerService;
import com.yellowpage.ndc.service.ProdGroupService;

public class ExportAction extends BaseAction {
	public String RESULT_QUERY = "query";


	private Configuration configuration;

	public void setConfiguration(Configuration configuration) {
		this.configuration = configuration;
	}

	private List<ProdCustomer> prodCustomerList = new ArrayList<ProdCustomer>();
	private List<Map> resultList = new ArrayList<Map>();
	private List<Map> ProdGroupresultList = new ArrayList<Map>();
	private List<Map> ProdClassresultList = new ArrayList<Map>();
	private List<Map> ManageRegionresultList = new ArrayList<Map>();
	
	private ProdCustomer prodCustomer;
	private ProdCustomerService prodCustomerService;
	private ProdGroup prodGroup;
	private ProdGroupService prodGroupService;
	private ProdClass prodClass;
	private ProdClassService prodClassService;
	private ManageRegion manageRegion;
	private ManageRegionService manageRegionService;
	
	private String selectedId;
	private String[] selectedIds;
	private String message;
	private int num;
	private int pagenum;

	private String query_prodClassCode1;
	private String query_prodClassName1;
	private String query_prodClassCode2;
	private String query_prodClassName2;
	private String query_custId;
	private String query_groupId;
	private String query_name1;
	private String query_name2;
	private String query_subname1;
	private String query_subname2;
	private String query_subname3;
	private String query_subname4;
	private String query_tel;
	private String query_telExt;
	private String query_faxFlag;
	private String query_sb;
	private String query_listOrder;
	private String query_regionCode;
	private String query_regionName;
	private String query_cityCode;
	private String query_cityName;
	private String query_destrictCode;
	private String query_destrictName;
	private String query_areaCode;
	private String query_addr;
	private String query_zip;
	private String query_pyAddr;
	private String query_engAddr;
	private String query_poix;
	private String query_poiy;
	private String query_custStatus;
	private String query_custTypeCode;
	private String query_classMainId;
	private String query_orgId;
	private String query_url;
	private String query_weibo;
	private String query_weixin;
	private String query_yixin;
	private String query_logo;
	private String query_safeStatus;
	private String query_bxName;
	private String query_pyName;
	private String query_engName;
	private String query_spName;
	private String query_sourceId;
	private String query_prodClassId;
	private String query_modifyTime;
	private String query_modifyEmpId;
	private String query_inputTime;
	private String query_inputEmpId;
	private String query_id;
	private String query_source;
	private String query_inputEmpCode;
	private String query_modifyEmpCode;
	private String query_status114yp;
	private String query_status360;
	
	
	private String prodgroup_prodClassCode1;
	private String prodgroup_prodClassName1;
	private String prodgroup_prodClassCode2;
	private String prodgroup_prodClassName2;
	private String prodgroup_groupId;
	private String prodgroup_name1;
	private String prodgroup_name2;
	private String prodgroup_subname1;
	private String prodgroup_subname2;
	private String prodgroup_subname3;
	private String prodgroup_subname4;
	private String prodgroup_tel;
	private String prodgroup_telExt;
	private String prodgroup_faxFlag;
	private String prodgroup_sb;
	private String prodgroup_listOrder;
	private String prodgroup_regionCode;
	private String prodgroup_regionName;
	private String prodgroup_cityCode;
	private String prodgroup_cityName;
	private String prodgroup_destrictCode;
	private String prodgroup_destrictName;
	private String prodgroup_areaCode;
	private String prodgroup_addr;
	private String prodgroup_zip;
	private String prodgroup_pyAddr;
	private String prodgroup_engAddr;
	private String prodgroup_poix;
	private String prodgroup_poiy;
	private String prodgroup_custStatus;
	private String prodgroup_custTypeCode;
	private String prodgroup_classMainId;
	private String prodgroup_orgId;
	private String prodgroup_url;
	private String prodgroup_weibo;
	private String prodgroup_weiboName;
	private String prodgroup_weixin;
	private String prodgroup_yixin;
	private String prodgroup_logo;
	private String prodgroup_safeStatus;
	private String prodgroup_bxName;
	private String prodgroup_pyName;
	private String prodgroup_engName;
	private String prodgroup_spName;
	private String prodgroup_prodClassId;
	private String prodgroup_modifyTime;
	private String prodgroup_modifyEmpId;
	private String prodgroup_inputTime;
	private String prodgroup_inputEmpId;
	private String prodgroup_id;
	private String prodgroup_inputEmpCode;
	private String prodgroup_modifyEmpCode;
	
	private String Prodclass_line;
	private String Prodclass_classId;
	private String Prodclass_cityCode;
	private String Prodclass_cityName;
	private String Prodclass_engName;
	private String Prodclass_pyName;
	private String Prodclass_bxName;
	private String Prodclass_note;
	private String Prodclass_name;
	private String Prodclass_type;
	private String Prodclass_status;
	private String Prodclass_code;	
	private String Prodclass_code1;
	private String Prodclass_name1;
	private String Prodclass_code2;
	private String Prodclass_name2;

	private String ManageRegion_regionCode;
	private String ManageRegion_shortName;
	private String ManageRegion_engName;
	private String ManageRegion_telLength;
	private String ManageRegion_areaCode;
	private String ManageRegion_abbrName;
	private String ManageRegion_note;
	private String ManageRegion_name;
	
	private String anyUpdateSelectId;
	private String[] selectedUpdate;
	protected PageRender pageRender;
	private String todownload;
	private String todownloadcsv;
	private String todownloaddbf;
/*	public void prepare() {
		super.prepare();

		if (this.selectedId != null && !this.selectedId.equals("")) {
			this.prodCustomer = prodCustomerService.getProdCustomer(Long
					.parseLong(selectedId));
		}
	}*/

	

	
	
	public String exportExcel() {	

		List<File> srcfile=new ArrayList<File>();  
		HttpServletRequest request = ServletActionContext.getRequest();
		HttpServletResponse response = ServletActionContext.getResponse();
		response.setContentType( "text/html;charset=GBK "); 
		String path = request.getSession().getServletContext().getRealPath("");
		path = path.replace("\\","//");
		FileOutputStream fos=null;
		String folder="/db_ndc_excel";
		 File file = new File(path+folder);  
		        if(!file.exists()){  
		            file.mkdir();  
		        }  

			try {

			/**
			 * ProdCustomer导出 
			 */
			boolean ProdCustomerisnull = false;
			boolean ProdGroupisnull = false;
			boolean ProdClassisnull = false;
			boolean ManageRegionisnull = false;
			Map queryMap = new HashMap();
			
			queryMap.put("cityCode", query_cityCode);
			queryMap.put("cityName", query_cityName);
			System.out.print(query_cityName);
			resultList = prodCustomerService.ProdCustomerexcel(queryMap);
			int resultListsize=resultList.size();		
			if (resultListsize ==0) {
				this.addActionError("** ProdCustomer无数据 !");
				ProdCustomerisnull = true;
			}else{
			int count = (int) Math.ceil((resultListsize / num) + 1);
			int i;
			int k = 0 + (pagenum - 1) * num;
			int last;
			if(pagenum==count){
				last=resultListsize;
			}else {
				last=num*pagenum;
			}
			if (pagenum > count) {
				this.addActionError("** ProdCustomer此页无数据 !");
				ProdCustomerisnull = true;
			} else {
				fos = new FileOutputStream(path + folder + "\\ProdCustomer"+(k+1)+"-"+last+".xls");
				HSSFWorkbook workbook = new HSSFWorkbook();
				HSSFSheet sheet = workbook.createSheet("ProdCustomer");
				sheet.setDefaultColumnWidth(15);
				HSSFRow row = sheet.createRow(0);			 
			row.createCell(0).setCellValue("一级分类编号 ");	
			row.createCell(1).setCellValue("一级分类名称 ");
			row.createCell(2).setCellValue("二级分类编号 ");
			row.createCell(3).setCellValue("二级分类名称 ");
			row.createCell(4).setCellValue("客户编号 ");
			row.createCell(5).setCellValue("品牌编号 ");
			row.createCell(6).setCellValue("客户名称1 ");
			row.createCell(7).setCellValue("客户名称2");
			
			row.createCell(8).setCellValue("一级分列名 ");
			row.createCell(9).setCellValue("二级分列名 ");
			row.createCell(10).setCellValue("三级分列名 ");
			row.createCell(11).setCellValue("四级分列名");
			
			row.createCell(12).setCellValue("区号");
			
			row.createCell(13).setCellValue("电话");
			row.createCell(14).setCellValue("分机");
			
			row.createCell(15).setCellValue("传真标志");
			row.createCell(16).setCellValue("总机标志");
			
			row.createCell(17).setCellValue("列名次序");
			row.createCell(18).setCellValue("地区代码");
			row.createCell(19).setCellValue("地区名称");
			row.createCell(20).setCellValue("城市代码");
			row.createCell(21).setCellValue("城市名称");
			
			row.createCell(22).setCellValue("区域代码");
			row.createCell(23).setCellValue("区域名称");
			
			row.createCell(24).setCellValue("地址");
			row.createCell(25).setCellValue("邮编");
			
			row.createCell(26).setCellValue("地址首拼音");
			row.createCell(27).setCellValue("英文地址");
			row.createCell(28).setCellValue("纬度");
			row.createCell(29).setCellValue("经度");
			
			row.createCell(30).setCellValue("客户状态");
			
			row.createCell(31).setCellValue("客户类型");
			row.createCell(32).setCellValue("分类主ID");
			row.createCell(33).setCellValue("ORGID");
			
			row.createCell(34).setCellValue("Url");
			row.createCell(35).setCellValue("微博");
			row.createCell(36).setCellValue("微信");	
			row.createCell(37).setCellValue("易信");
			
			row.createCell(38).setCellValue("LOGO");
			row.createCell(39).setCellValue("安全状态");
			row.createCell(40).setCellValue("笔序");
			row.createCell(41).setCellValue("英文名");
			
			row.createCell(42).setCellValue("来源");
			
			row.createCell(43).setCellValue("来源ID");
			row.createCell(44).setCellValue("分类ID");
			
			row.createCell(45).setCellValue("拼音");
			row.createCell(46).setCellValue("首拼");
			row.createCell(47).setCellValue("修改时间");
			row.createCell(48).setCellValue("修改人");
			row.createCell(49).setCellValue("输入时间");
			row.createCell(50).setCellValue("输入人 ");		
			
			row.createCell(51).setCellValue("114");
			row.createCell(52).setCellValue("360 ");	
			
			int r=0;
			for ( i = k; i < resultList.size()&&i<k+num; i++,r++) {					
				HSSFRow data_row = sheet.createRow(r+1);			
			   Map result = (Map)resultList.get(i);	 		 
				data_row.createCell(0).setCellValue(result.get("PROD_CLASS_CODE1")!=null?result.get("PROD_CLASS_CODE1").toString():"");					
				data_row.createCell(1).setCellValue(result.get("PROD_CLASS_NAME1")!=null?result.get("PROD_CLASS_NAME1").toString():"");
				data_row.createCell(2).setCellValue(result.get("PROD_CLASS_CODE2")!=null?result.get("PROD_CLASS_CODE2").toString():"");
				data_row.createCell(3).setCellValue(result.get("PROD_CLASS_NAME2")!=null?result.get("PROD_CLASS_NAME2").toString():"");
				data_row.createCell(4).setCellValue(result.get("CUST_ID")!=null?result.get("CUST_ID").toString():"");
				data_row.createCell(5).setCellValue(result.get("GROUP_ID")!=null?result.get("GROUP_ID").toString():"");
				data_row.createCell(6).setCellValue(result.get("NAME1")!=null?result.get("NAME1").toString():"");
				data_row.createCell(7).setCellValue(result.get("NAME2")!=null?result.get("NAME2").toString():"");
				
				data_row.createCell(8).setCellValue(result.get("SUBNAME1")!=null?result.get("SUBNAME1").toString():"");
				data_row.createCell(9).setCellValue(result.get("SUBNAME2")!=null?result.get("SUBNAME2").toString():"");
				data_row.createCell(10).setCellValue(result.get("SUBNAME3")!=null?result.get("SUBNAME3").toString():"");
				data_row.createCell(11).setCellValue(result.get("SUBNAME4")!=null?result.get("SUBNAME4").toString():"");
				
				data_row.createCell(12).setCellValue(result.get("AREA_CODE")!=null?result.get("AREA_CODE").toString():"");
				data_row.createCell(13).setCellValue(result.get("TEL")!=null?result.get("TEL").toString():"");
				data_row.createCell(14).setCellValue(result.get("TEL_EXT")!=null?result.get("TEL_EXT").toString():"");		
				
				data_row.createCell(15).setCellValue(result.get("FAX_FLAG")!=null?result.get("FAX_FLAG").toString():"");
				data_row.createCell(16).setCellValue(result.get("SB")!=null?result.get("SB").toString():"");	
				
				data_row.createCell(17).setCellValue(result.get("LIST_ORDER")!=null?result.get("LIST_ORDER").toString():"");
				data_row.createCell(18).setCellValue(result.get("REGION_CODE")!=null?result.get("REGION_CODE").toString():"");
				data_row.createCell(19).setCellValue(result.get("REGION_NAME")!=null?result.get("REGION_NAME").toString():"");
				data_row.createCell(20).setCellValue(result.get("CITY_CODE")!=null?result.get("CITY_CODE").toString():"");
				data_row.createCell(21).setCellValue(result.get("CITY_NAME")!=null?result.get("CITY_NAME").toString():"");
				
				data_row.createCell(22).setCellValue(result.get("DESTRICT_CODE")!=null?result.get("DESTRICT_CODE").toString():"");
				data_row.createCell(23).setCellValue(result.get("DESTRICT_NAME")!=null?result.get("DESTRICT_NAME").toString():"");
				
				data_row.createCell(24).setCellValue(result.get("ADDR")!=null?result.get("ADDR").toString():"");
				data_row.createCell(25).setCellValue(result.get("ZIP")!=null?result.get("ZIP").toString():"");
				
				data_row.createCell(26).setCellValue(result.get("PY_ADDR")!=null?result.get("PY_ADDR").toString():"");
				data_row.createCell(27).setCellValue(result.get("ENG_ADDR")!=null?result.get("ENG_ADDR").toString():"");
				data_row.createCell(28).setCellValue(result.get("POIX")!=null?result.get("POIX").toString():"");
				data_row.createCell(29).setCellValue(result.get("POIY")!=null?result.get("POIY").toString():"");
				
				data_row.createCell(30).setCellValue(result.get("CUST_STATUS")!=null?result.get("CUST_STATUS").toString():"");
				
				data_row.createCell(31).setCellValue(result.get("CUST_TYPE_CODE")!=null?result.get("CUST_TYPE_CODE").toString():"");
				data_row.createCell(32).setCellValue(result.get("CLASS_MAIN_ID")!=null?result.get("CLASS_MAIN_ID").toString():"");
				data_row.createCell(33).setCellValue(result.get("ORG_ID")!=null?result.get("ORG_ID").toString():"");
				
				data_row.createCell(34).setCellValue(result.get("URL")!=null?result.get("URL").toString():"");
				data_row.createCell(35).setCellValue(result.get("WEIBO")!=null?result.get("WEIBO").toString():"");		
				data_row.createCell(36).setCellValue(result.get("WEIXIN")!=null?result.get("WEIXIN").toString():"");
				data_row.createCell(37).setCellValue(result.get("YIXIN")!=null?result.get("YIXIN").toString():"");
				
				data_row.createCell(38).setCellValue(result.get("LOGO")!=null?result.get("LOGO").toString():"");
				data_row.createCell(39).setCellValue(result.get("SAFE_STATUS")!=null?result.get("SAFE_STATUS").toString():"");
				data_row.createCell(40).setCellValue(result.get("BX_NAME")!=null?result.get("BX_NAME").toString():"");		
				data_row.createCell(41).setCellValue(result.get("ENG_NAME")!=null?result.get("ENG_NAME").toString():"");
				
				data_row.createCell(42).setCellValue(result.get("SOURCE")!=null?result.get("SOURCE").toString():"");
				
				data_row.createCell(43).setCellValue(result.get("SOURCE_ID")!=null?result.get("SOURCE_ID").toString():"");
				data_row.createCell(44).setCellValue(result.get("PROD_CLASS_ID")!=null?result.get("PROD_CLASS_ID").toString():"");
				
				data_row.createCell(45).setCellValue(result.get("PY_NAME")!=null?result.get("PY_NAME").toString():"");
				data_row.createCell(46).setCellValue(result.get("SP_NAME")!=null?result.get("SP_NAME").toString():"");				
				data_row.createCell(47).setCellValue(result.get("MODIFY_TIME")!=null?result.get("MODIFY_TIME").toString():"");
				data_row.createCell(48).setCellValue(result.get("MODIFY_EMP_CODE")!=null?result.get("MODIFY_EMP_CODE").toString():"");
				data_row.createCell(49).setCellValue(result.get("INPUT_TIME")!=null?result.get("INPUT_TIME").toString():"");
				data_row.createCell(50).setCellValue(result.get("INPUT_EMP_CODE")!=null?result.get("INPUT_EMP_CODE").toString():"");
				
				data_row.createCell(51).setCellValue(result.get("STATUS_114YP")!=null?result.get("STATUS_114YP").toString():"");
				data_row.createCell(52).setCellValue(result.get("STATUS_360")!=null?result.get("STATUS_360").toString():"");
				
				}
				workbook.write(fos);
				srcfile.add(new File(path + folder + "\\ProdCustomer"+(k+1)+"-"+last+".xls"));
				response.flushBuffer();
				fos.close();
				this.addActionMessage("导出ProdCustomer完成");
			}
			}
			/**
			 * ProdGroup导出
			 */		
			FileOutputStream fos2 = null;
			ProdGroupresultList = prodGroupService.ProdGroupexcel(queryMap);
			int ProdGroupsize = ProdGroupresultList.size();
			if (ProdGroupsize ==0) {
				this.addActionError("** ProdGroupsize无数据 !");
				ProdGroupisnull = true;
			}else{
			int count2 = (int) Math.ceil((ProdGroupsize / num) + 1);
			int i2;
			int k2 = 0 + (pagenum - 1) * num;
			int last2;
			if(pagenum==count2){
				last2=ProdGroupsize;
			}else {
				last2=num*pagenum;
			}
			if (pagenum > count2) {
				this.addActionError("** ProdGroup此页无数据 !");
				ProdGroupisnull = true;
			} else {
				fos2 = new FileOutputStream(path + folder + "\\ProdGroup"+(k2+1)+"-"+last2+".xls");
				HSSFWorkbook workbook = new HSSFWorkbook();
				HSSFSheet ProdGroupsheet = workbook.createSheet("ProdGroup");
				ProdGroupsheet.setDefaultColumnWidth(15);
			HSSFRow ProdGrouprow = ProdGroupsheet.createRow(0);					 
			ProdGrouprow.createCell(0).setCellValue("一级分类编号 ");	
			ProdGrouprow.createCell(1).setCellValue("一级分类名称 ");
			ProdGrouprow.createCell(2).setCellValue("二级分类编号 ");
			ProdGrouprow.createCell(3).setCellValue("二级分类名称 ");
			ProdGrouprow.createCell(4).setCellValue("品牌编号 ");
			ProdGrouprow.createCell(5).setCellValue("品牌名称1 ");
			ProdGrouprow.createCell(6).setCellValue("品牌名称2 ");
			
			ProdGrouprow.createCell(7).setCellValue("一级分列名 ");
			ProdGrouprow.createCell(8).setCellValue("二级分列名 ");
			ProdGrouprow.createCell(9).setCellValue("三级分列名 ");
			ProdGrouprow.createCell(10).setCellValue("四级分列名 ");
			
			ProdGrouprow.createCell(11).setCellValue("区号 ");
			ProdGrouprow.createCell(12).setCellValue("电话 ");
			ProdGrouprow.createCell(13).setCellValue("分机 ");
			
			ProdGrouprow.createCell(14).setCellValue("电话2 ");
			ProdGrouprow.createCell(15).setCellValue("电话3 ");
			ProdGrouprow.createCell(16).setCellValue("电话4 ");
			ProdGrouprow.createCell(17).setCellValue("传真标志 ");
			ProdGrouprow.createCell(18).setCellValue("总机标志 ");
			
			ProdGrouprow.createCell(19).setCellValue("地区代码 ");
			ProdGrouprow.createCell(20).setCellValue("地区名称 ");
			ProdGrouprow.createCell(21).setCellValue("城市代码 ");
			ProdGrouprow.createCell(22).setCellValue("城市名称 ");			
			ProdGrouprow.createCell(23).setCellValue("区代码 ");
			ProdGrouprow.createCell(24).setCellValue("区名称 ");			
			ProdGrouprow.createCell(25).setCellValue("地址 ");
			ProdGrouprow.createCell(26).setCellValue("邮编 ");
			
			ProdGrouprow.createCell(27).setCellValue("地址首拼音 ");
			ProdGrouprow.createCell(28).setCellValue("英文地址 ");
			
			ProdGrouprow.createCell(29).setCellValue("Poix ");
			ProdGrouprow.createCell(30).setCellValue("Poiy ");
			
			ProdGrouprow.createCell(31).setCellValue("客户状态 ");
			ProdGrouprow.createCell(32).setCellValue("客户类型 ");
			ProdGrouprow.createCell(33).setCellValue("分类主ID ");
			ProdGrouprow.createCell(34).setCellValue("ORGID ");
			
			ProdGrouprow.createCell(35).setCellValue("Url ");	
			ProdGrouprow.createCell(36).setCellValue("列名次序 ");
			
			ProdGrouprow.createCell(37).setCellValue("微博名 ");
			
			ProdGrouprow.createCell(38).setCellValue("微博 ");
			ProdGrouprow.createCell(39).setCellValue("微信 ");
			ProdGrouprow.createCell(40).setCellValue("易信 ");
			
			ProdGrouprow.createCell(41).setCellValue("LOGO ");
			ProdGrouprow.createCell(42).setCellValue("安全状态 ");
			ProdGrouprow.createCell(43).setCellValue("笔序 ");
			ProdGrouprow.createCell(44).setCellValue("拼音 ");
			ProdGrouprow.createCell(45).setCellValue("英文名 ");
			ProdGrouprow.createCell(46).setCellValue("首拼 ");
			ProdGrouprow.createCell(47).setCellValue("分类ID ");
			
			ProdGrouprow.createCell(48).setCellValue("修改时间 ");
			ProdGrouprow.createCell(49).setCellValue("修改人 ");
			ProdGrouprow.createCell(50).setCellValue("输入时间 ");
			ProdGrouprow.createCell(51).setCellValue("输入人 ");	
			 int r2=0;
			for ( i2 = k2; i2 < ProdGroupresultList.size()&&i2<k2+num; i2++,r2++) {			
				HSSFRow ProdGroupdata_row = ProdGroupsheet.createRow(r2+1);			
			   Map ProdGroupresult = (Map)ProdGroupresultList.get(i2);	 		 
			   ProdGroupdata_row.createCell(0).setCellValue(ProdGroupresult.get("PROD_CLASS_CODE1")!=null?ProdGroupresult.get("PROD_CLASS_CODE1").toString():"");					
			   ProdGroupdata_row.createCell(1).setCellValue(ProdGroupresult.get("PROD_CLASS_NAME1")!=null?ProdGroupresult.get("PROD_CLASS_NAME1").toString():"");
			   ProdGroupdata_row.createCell(2).setCellValue(ProdGroupresult.get("PROD_CLASS_CODE2")!=null?ProdGroupresult.get("PROD_CLASS_CODE2").toString():"");
			   ProdGroupdata_row.createCell(3).setCellValue(ProdGroupresult.get("PROD_CLASS_NAME2")!=null?ProdGroupresult.get("PROD_CLASS_NAME2").toString():"");
			   ProdGroupdata_row.createCell(4).setCellValue(ProdGroupresult.get("GROUP_ID")!=null?ProdGroupresult.get("GROUP_ID").toString():"");
			   ProdGroupdata_row.createCell(5).setCellValue(ProdGroupresult.get("NAME1")!=null?ProdGroupresult.get("NAME1").toString():"");
			   ProdGroupdata_row.createCell(6).setCellValue(ProdGroupresult.get("NAME2")!=null?ProdGroupresult.get("NAME2").toString():"");		
			   
			   ProdGroupdata_row.createCell(7).setCellValue(ProdGroupresult.get("SUBNAME1")!=null?ProdGroupresult.get("SUBNAME1").toString():"");
			   ProdGroupdata_row.createCell(8).setCellValue(ProdGroupresult.get("SUBNAME2")!=null?ProdGroupresult.get("SUBNAME2").toString():"");
			   ProdGroupdata_row.createCell(9).setCellValue(ProdGroupresult.get("SUBNAME3")!=null?ProdGroupresult.get("SUBNAME3").toString():"");
			   ProdGroupdata_row.createCell(10).setCellValue(ProdGroupresult.get("SUBNAME4")!=null?ProdGroupresult.get("SUBNAME4").toString():"");
			   
			   ProdGroupdata_row.createCell(11).setCellValue(ProdGroupresult.get("AREA_CODE")!=null?ProdGroupresult.get("AREA_CODE").toString():"");
			   ProdGroupdata_row.createCell(12).setCellValue(ProdGroupresult.get("TEL")!=null?ProdGroupresult.get("TEL").toString():"");
			   ProdGroupdata_row.createCell(13).setCellValue(ProdGroupresult.get("TEL_EXT")!=null?ProdGroupresult.get("TEL_EXT").toString():"");			
			   
			   ProdGroupdata_row.createCell(14).setCellValue(ProdGroupresult.get("TEL2")!=null?ProdGroupresult.get("TEL2").toString():"");
			   ProdGroupdata_row.createCell(15).setCellValue(ProdGroupresult.get("TEL3")!=null?ProdGroupresult.get("TEL3").toString():"");
			   ProdGroupdata_row.createCell(16).setCellValue(ProdGroupresult.get("TEL4")!=null?ProdGroupresult.get("TEL4").toString():"");
			   ProdGroupdata_row.createCell(17).setCellValue(ProdGroupresult.get("FAX_FLAG")!=null?ProdGroupresult.get("FAX_FLAG").toString():"");
			   ProdGroupdata_row.createCell(18).setCellValue(ProdGroupresult.get("SB")!=null?ProdGroupresult.get("SB").toString():"");
			   
			   ProdGroupdata_row.createCell(19).setCellValue(ProdGroupresult.get("REGION_CODE")!=null?ProdGroupresult.get("REGION_CODE").toString():"");		
			   ProdGroupdata_row.createCell(20).setCellValue(ProdGroupresult.get("REGION_NAME")!=null?ProdGroupresult.get("REGION_NAME").toString():"");
			   ProdGroupdata_row.createCell(21).setCellValue(ProdGroupresult.get("CITY_CODE")!=null?ProdGroupresult.get("CITY_CODE").toString():"");
			   ProdGroupdata_row.createCell(22).setCellValue(ProdGroupresult.get("CITY_NAME")!=null?ProdGroupresult.get("CITY_NAME").toString():"");				
			   ProdGroupdata_row.createCell(23).setCellValue(ProdGroupresult.get("DESTRICT_CODE")!=null?ProdGroupresult.get("DESTRICT_CODE").toString():"");
			   ProdGroupdata_row.createCell(24).setCellValue(ProdGroupresult.get("DESTRICT_NAME")!=null?ProdGroupresult.get("DESTRICT_NAME").toString():"");				
			   ProdGroupdata_row.createCell(25).setCellValue(ProdGroupresult.get("ADDR")!=null?ProdGroupresult.get("ADDR").toString():"");
			   ProdGroupdata_row.createCell(26).setCellValue(ProdGroupresult.get("ZIP")!=null?ProdGroupresult.get("ZIP").toString():"");			
			  
			   ProdGroupdata_row.createCell(27).setCellValue(ProdGroupresult.get("PY_ADDR")!=null?ProdGroupresult.get("PY_ADDR").toString():"");
			   ProdGroupdata_row.createCell(28).setCellValue(ProdGroupresult.get("ENG_ADDR")!=null?ProdGroupresult.get("ENG_ADDR").toString():"");				
			   
			   ProdGroupdata_row.createCell(29).setCellValue(ProdGroupresult.get("POIX")!=null?ProdGroupresult.get("POIX").toString():"");
			   ProdGroupdata_row.createCell(30).setCellValue(ProdGroupresult.get("POIY")!=null?ProdGroupresult.get("POIY").toString():"");	
			   
			   ProdGroupdata_row.createCell(31).setCellValue(ProdGroupresult.get("CUST_STATUS")!=null?ProdGroupresult.get("CUST_STATUS").toString():"");
			   ProdGroupdata_row.createCell(32).setCellValue(ProdGroupresult.get("CUST_TYPE_CODE")!=null?ProdGroupresult.get("CUST_TYPE_CODE").toString():"");	
			   ProdGroupdata_row.createCell(33).setCellValue(ProdGroupresult.get("CLASS_MAIN_ID")!=null?ProdGroupresult.get("CLASS_MAIN_ID").toString():"");
			   ProdGroupdata_row.createCell(34).setCellValue(ProdGroupresult.get("ORG_ID")!=null?ProdGroupresult.get("ORG_ID").toString():"");	
			   
			   ProdGroupdata_row.createCell(35).setCellValue(ProdGroupresult.get("URL")!=null?ProdGroupresult.get("URL").toString():"");
			   ProdGroupdata_row.createCell(36).setCellValue(ProdGroupresult.get("LIST_ORDER")!=null?ProdGroupresult.get("LIST_ORDER").toString():"");				
			   
			   ProdGroupdata_row.createCell(37).setCellValue(ProdGroupresult.get("WEIBO_NAME")!=null?ProdGroupresult.get("WEIBO_NAME").toString():"");
			   
			   ProdGroupdata_row.createCell(38).setCellValue(ProdGroupresult.get("WEIBO")!=null?ProdGroupresult.get("WEIBO").toString():"");
			   ProdGroupdata_row.createCell(39).setCellValue(ProdGroupresult.get("WEIXIN")!=null?ProdGroupresult.get("WEIXIN").toString():"");
			   ProdGroupdata_row.createCell(40).setCellValue(ProdGroupresult.get("YIXIN")!=null?ProdGroupresult.get("YIXIN").toString():"");		
			   
			   ProdGroupdata_row.createCell(41).setCellValue(ProdGroupresult.get("LOGO")!=null?ProdGroupresult.get("LOGO").toString():"");
			   ProdGroupdata_row.createCell(42).setCellValue(ProdGroupresult.get("SAFE_STATUS")!=null?ProdGroupresult.get("WEIBO").toString():"");
			   ProdGroupdata_row.createCell(43).setCellValue(ProdGroupresult.get("BX_NAME")!=null?ProdGroupresult.get("WEIXIN").toString():"");
			   ProdGroupdata_row.createCell(44).setCellValue(ProdGroupresult.get("PY_NAME")!=null?ProdGroupresult.get("YIXIN").toString():"");	
			   ProdGroupdata_row.createCell(45).setCellValue(ProdGroupresult.get("ENG_NAME")!=null?ProdGroupresult.get("WEIBO").toString():"");
			   ProdGroupdata_row.createCell(46).setCellValue(ProdGroupresult.get("SP_NAME")!=null?ProdGroupresult.get("WEIXIN").toString():"");
			   ProdGroupdata_row.createCell(47).setCellValue(ProdGroupresult.get("PROD_CLASS_ID")!=null?ProdGroupresult.get("YIXIN").toString():"");		
			   
			   ProdGroupdata_row.createCell(48).setCellValue(ProdGroupresult.get("MODIFY_TIME")!=null?ProdGroupresult.get("MODIFY_TIME").toString():"");
			   ProdGroupdata_row.createCell(49).setCellValue(ProdGroupresult.get("MODIFY_EMP_ID")!=null?ProdGroupresult.get("MODIFY_EMP_ID").toString():"");
			   ProdGroupdata_row.createCell(50).setCellValue(ProdGroupresult.get("INPUT_TIME")!=null?ProdGroupresult.get("INPUT_TIME").toString():"");
			   ProdGroupdata_row.createCell(51).setCellValue(ProdGroupresult.get("INPUT_EMP_ID")!=null?ProdGroupresult.get("INPUT_EMP_ID").toString():"");
				}
				workbook.write(fos2);
				srcfile.add(new File(path + folder + "\\ProdGroup"+(k2+1)+"-"+last2+".xls"));
				response.flushBuffer();
				fos2.close();
				this.addActionMessage("导出ProdGroup完成");
			}	
			}
			/**
				 *  ProdClass导出
				 */	
			FileOutputStream fos3 = null;
			ProdClassresultList = prodClassService.ProdClassexcel(queryMap);
			int ProdClasssize = ProdClassresultList.size();
			if (ProdClasssize ==0) {
				this.addActionError("** ProdClasssize无数据 !");
				ProdClassisnull = true;
			}else{
			int count3 = (int) Math.ceil((ProdClasssize / num) + 1);
			int i3;
			int k3 = 0 + (pagenum - 1) * num;
			int last3;
			if(pagenum==count3){
				last3=ProdClasssize;
			}else {
				last3=num*pagenum;
			}
			if (pagenum > count3) {
				this.addActionError("** ProdClass此页无数据 !");
				ProdClassisnull = true;
			} else {
			fos3 = new FileOutputStream(path+folder+"\\ProdClass"+(k3+1)+"-"+last3+".xls");
			HSSFWorkbook workbook = new HSSFWorkbook();	
			HSSFSheet ProdClasssheet = workbook.createSheet("ProdClass");	
			ProdClasssheet.setDefaultColumnWidth(15);
			HSSFRow ProdClassrow = ProdClasssheet.createRow(0);					 
			ProdClassrow.createCell(0).setCellValue("层级和次序 ");	
			ProdClassrow.createCell(1).setCellValue("分类ID ");
			ProdClassrow.createCell(2).setCellValue("城市代码 ");
			ProdClassrow.createCell(3).setCellValue("城市名称 ");
			ProdClassrow.createCell(4).setCellValue("英文分类名 ");
			ProdClassrow.createCell(5).setCellValue("分类名称首拼 ");
			ProdClassrow.createCell(6).setCellValue("分类名称笔序 ");
			ProdClassrow.createCell(7).setCellValue("备注 ");
			ProdClassrow.createCell(8).setCellValue("分类名称 ");
			ProdClassrow.createCell(9).setCellValue("类型 ");
			ProdClassrow.createCell(10).setCellValue("状态 ");
			ProdClassrow.createCell(11).setCellValue("分类编号 ");
			int r3=0;
			for ( i3 = k3; i3 < ProdClassresultList.size()&&i3<k3+num; i3++,r3++) {			
				HSSFRow ProdClassdata_row = ProdClasssheet.createRow(r3+1);				
			   Map ProdClassresult = (Map)ProdClassresultList.get(i3);	 		 
			   ProdClassdata_row.createCell(0).setCellValue(ProdClassresult.get("LINE")!=null?ProdClassresult.get("LINE").toString():"");					
			   ProdClassdata_row.createCell(1).setCellValue(ProdClassresult.get("CLASS_ID")!=null?ProdClassresult.get("CLASS_ID").toString():"");
			   ProdClassdata_row.createCell(2).setCellValue(ProdClassresult.get("CITY_CODE")!=null?ProdClassresult.get("CITY_CODE").toString():"");
			   ProdClassdata_row.createCell(3).setCellValue(ProdClassresult.get("CITY_NAME")!=null?ProdClassresult.get("CITY_NAME").toString():"");
			   ProdClassdata_row.createCell(4).setCellValue(ProdClassresult.get("ENG_NAME")!=null?ProdClassresult.get("ENG_NAME").toString():"");
			   ProdClassdata_row.createCell(5).setCellValue(ProdClassresult.get("PY_NAME")!=null?ProdClassresult.get("PY_NAME").toString():"");
			   ProdClassdata_row.createCell(6).setCellValue(ProdClassresult.get("BX_NAME")!=null?ProdClassresult.get("BX_NAME").toString():"");
			   ProdClassdata_row.createCell(7).setCellValue(ProdClassresult.get("NOTE")!=null?ProdClassresult.get("NOTE").toString():"");
			   ProdClassdata_row.createCell(8).setCellValue(ProdClassresult.get("NAME")!=null?ProdClassresult.get("NAME").toString():"");
			   ProdClassdata_row.createCell(9).setCellValue(ProdClassresult.get("TYPE")!=null?ProdClassresult.get("TYPE").toString():"");		
			   ProdClassdata_row.createCell(10).setCellValue(ProdClassresult.get("STATUS")!=null?ProdClassresult.get("STATUS").toString():"");
			   ProdClassdata_row.createCell(11).setCellValue(ProdClassresult.get("CODE")!=null?ProdClassresult.get("CODE").toString():"");
				}
				workbook.write(fos3);
				srcfile.add(new File(path + folder + "\\ProdClass"+(k3+1)+"-"+last3+".xls"));
				response.flushBuffer();
				fos3.close();
				this.addActionMessage("导出ProdClass完成");
			}
			}
			/**
				 *  ManageRegion导出
				 */	
			FileOutputStream fos4 = null;
		    queryMap.put("regionCode", query_cityCode);
    	    queryMap.put("name", query_cityName);
			ManageRegionresultList = manageRegionService
					.ManageRegionexcel(queryMap);
			int ManageRegionsize = ManageRegionresultList.size();
			if (ManageRegionsize ==0) {
				this.addActionError("** ManageRegionsize无数据 !");
				ManageRegionisnull = true;
			}else{
			int count4 = (int) Math.ceil((ManageRegionsize / num) + 1);
			int i4;
			int k4 = 0 + (pagenum - 1) * num;
			int last4;
			if(pagenum==count4){
				last4=ManageRegionsize;
			}else {
				last4=num*pagenum;
			}
			if (pagenum > count4) {
				this.addActionError("** ManageRegion此页无数据 !");
				ManageRegionisnull = true;
			} else {
			fos4 = new FileOutputStream(path+folder+"\\ManageRegion"+(k4+1)+"-"+last4+".xls");
			HSSFWorkbook workbook = new HSSFWorkbook();	
			HSSFSheet ManageRegionsheet = workbook.createSheet("ManageRegion");	
			ManageRegionsheet.setDefaultColumnWidth(15);
			HSSFRow ManageRegionrow = ManageRegionsheet.createRow(0);					 
			ManageRegionrow.createCell(0).setCellValue("地区代码 ");	
			ManageRegionrow.createCell(1).setCellValue("短名称 ");
			ManageRegionrow.createCell(2).setCellValue("英文名 ");
			ManageRegionrow.createCell(3).setCellValue("电话位数 ");
			ManageRegionrow.createCell(4).setCellValue("区号 ");
			ManageRegionrow.createCell(5).setCellValue("简称 ");
			ManageRegionrow.createCell(6).setCellValue("备注 ");
			ManageRegionrow.createCell(7).setCellValue("名称 ");
			int r4=0;
			for ( i4 = k4; i4 < ManageRegionresultList.size()&&i4<k4+num; i4++,r4++) {					
				HSSFRow ManageRegiondata_row = ManageRegionsheet.createRow(r4+1);			
			   Map ManageRegionresult = (Map)ManageRegionresultList.get(i4);	 		 
			   ManageRegiondata_row.createCell(0).setCellValue(ManageRegionresult.get("REGION_CODE")!=null?ManageRegionresult.get("REGION_CODE").toString():"");					
			   ManageRegiondata_row.createCell(1).setCellValue(ManageRegionresult.get("SHORT_NAME")!=null?ManageRegionresult.get("SHORT_NAME").toString():"");
			   ManageRegiondata_row.createCell(2).setCellValue(ManageRegionresult.get("ENG_NAME")!=null?ManageRegionresult.get("ENG_NAME").toString():"");
			   ManageRegiondata_row.createCell(3).setCellValue(ManageRegionresult.get("TEL_LENGTH")!=null?ManageRegionresult.get("TEL_LENGTH").toString():"");
			   ManageRegiondata_row.createCell(4).setCellValue(ManageRegionresult.get("AREA_CODE")!=null?ManageRegionresult.get("AREA_CODE").toString():"");
			   ManageRegiondata_row.createCell(5).setCellValue(ManageRegionresult.get("ABBR_NAME")!=null?ManageRegionresult.get("ABBR_NAME").toString():"");
			   ManageRegiondata_row.createCell(6).setCellValue(ManageRegionresult.get("NOTE")!=null?ManageRegionresult.get("NOTE").toString():"");
			   ManageRegiondata_row.createCell(7).setCellValue(ManageRegionresult.get("NAME")!=null?ManageRegionresult.get("NAME").toString():"");
				}	
				workbook.write(fos4);
				srcfile.add(new File(path + folder + "\\ManageRegion"+(k4+1)+"-"+last4+".xls"));
				response.flushBuffer();
				fos4.close();
				this.addActionMessage("导出ManageRegion完成");
			}
			}
			if (ProdCustomerisnull == true && ProdGroupisnull == true
					& ProdClassisnull == true & ManageRegionisnull == true) {
				todownload = "";
				this.addActionMessage("请重新导出数据");
			} else {
				todownload = "";
				File zipfile = new File(path + folder + ".zip");
				this.zipFiles(srcfile, zipfile);
				todownload = "window.open('db_ndc_excel.zip');";
			}
		} catch (Exception e) {
				log.error(e.getMessage(), e);
				this.addActionError("** 生成文件错误 !");
				
			} finally {
				if (fos != null) {
					try {
						//outp.close();
						fos.close();

					} catch (IOException e) {
						log.error(e.getMessage(), e);
					}
				}
			}	
			
			return RESULT_QUERY;
		}	
	public void zipFiles(List<File> srcfile, File zipfile) {  
        byte[] buf = new byte[1024];  
        try {  
            // Create the ZIP file  
            ZipOutputStream out = new ZipOutputStream(new FileOutputStream(zipfile));  
            // Compress the files  
            for (int i = 0; i < srcfile.size(); i++) {  
                File file = srcfile.get(i);  
                FileInputStream in = new FileInputStream(file);  
                // Add ZIP entry to output stream.  
                out.putNextEntry(new ZipEntry(file.getName()));  
                // Transfer bytes from the file to the ZIP file  
                int len;  
                while ((len = in.read(buf)) > 0) {  
                    out.write(buf, 0, len);  
                }  
                // Complete the entry  
                out.closeEntry();  
                in.close();  
            }  
            // Complete the ZIP file  
            out.close(); 
        } catch (IOException e) {  
           e.printStackTrace();
        }  
    }  
	public String exportCSV() {	

		List<File> srcfile=new ArrayList<File>();  
		HttpServletRequest request = ServletActionContext.getRequest();
		HttpServletResponse response = ServletActionContext.getResponse();
		response.setContentType( "text/html;charset=GBK "); 
		String path = request.getSession().getServletContext().getRealPath("");
		path = path.replace("\\","//");
		FileOutputStream fos=null;
		String folder="/db_ndc_csv";
		 File file = new File(path+folder);  
		        if(!file.exists()){  
		            file.mkdir();  
		        }  

			try {

			/**
			 * ProdCustomer导出 
			 */
			boolean ProdCustomerisnull = false;
			boolean ProdGroupisnull = false;
			boolean ProdClassisnull = false;
			boolean ManageRegionisnull = false;
			Map queryMap = new HashMap();
			
			queryMap.put("cityCode", query_cityCode);
			queryMap.put("cityName", query_cityName);
			System.out.print(query_cityName);
			resultList = prodCustomerService.ProdCustomerexcel(queryMap);
			int resultListsize=resultList.size();		
			if (resultListsize ==0) {
				this.addActionError("** ProdCustomer无数据 !");
				ProdCustomerisnull = true;
			}else{
			int count = (int) Math.ceil((resultListsize / num) + 1);
			int i;
			int k = 0 + (pagenum - 1) * num;
			int last;
			if(pagenum==count){
				last=resultListsize;
			}else {
				last=num*pagenum;
			}
			if (pagenum > count) {
				this.addActionError("** ProdCustomer此页无数据 !");
				ProdCustomerisnull = true;
			} else {
				fos = new FileOutputStream(path + folder + "\\ProdCustomer"+(k+1)+"-"+last+".csv");
				HSSFWorkbook workbook = new HSSFWorkbook();
				HSSFSheet sheet = workbook.createSheet("ProdCustomer");
				sheet.setDefaultColumnWidth(15);
				HSSFRow row = sheet.createRow(0);			 
			row.createCell(0).setCellValue("一级分类编号 ");	
			row.createCell(1).setCellValue("一级分类名称 ");
			row.createCell(2).setCellValue("二级分类编号 ");
			row.createCell(3).setCellValue("二级分类名称 ");
			row.createCell(4).setCellValue("客户编号 ");
			row.createCell(5).setCellValue("品牌编号 ");
			row.createCell(6).setCellValue("客户名称1 ");
			row.createCell(7).setCellValue("客户名称2");
			
			row.createCell(8).setCellValue("一级分列名 ");
			row.createCell(9).setCellValue("二级分列名 ");
			row.createCell(10).setCellValue("三级分列名 ");
			row.createCell(11).setCellValue("四级分列名");
			
			row.createCell(12).setCellValue("区号");
			
			row.createCell(13).setCellValue("电话");
			row.createCell(14).setCellValue("分机");
			
			row.createCell(15).setCellValue("传真标志");
			row.createCell(16).setCellValue("总机标志");
			
			row.createCell(17).setCellValue("列名次序");
			row.createCell(18).setCellValue("地区代码");
			row.createCell(19).setCellValue("地区名称");
			row.createCell(20).setCellValue("城市代码");
			row.createCell(21).setCellValue("城市名称");
			
			row.createCell(22).setCellValue("区域代码");
			row.createCell(23).setCellValue("区域名称");
			
			row.createCell(24).setCellValue("地址");
			row.createCell(25).setCellValue("邮编");
			
			row.createCell(26).setCellValue("地址首拼音");
			row.createCell(27).setCellValue("英文地址");
			row.createCell(28).setCellValue("纬度");
			row.createCell(29).setCellValue("经度");
			
			row.createCell(30).setCellValue("客户状态");
			
			row.createCell(31).setCellValue("客户类型");
			row.createCell(32).setCellValue("分类主ID");
			row.createCell(33).setCellValue("ORGID");
			
			row.createCell(34).setCellValue("Url");
			row.createCell(35).setCellValue("微博");
			row.createCell(36).setCellValue("微信");	
			row.createCell(37).setCellValue("易信");
			
			row.createCell(38).setCellValue("LOGO");
			row.createCell(39).setCellValue("安全状态");
			row.createCell(40).setCellValue("笔序");
			row.createCell(41).setCellValue("英文名");
			
			row.createCell(42).setCellValue("来源");
			
			row.createCell(43).setCellValue("来源ID");
			row.createCell(44).setCellValue("分类ID");
			
			row.createCell(45).setCellValue("拼音");
			row.createCell(46).setCellValue("首拼");
			row.createCell(47).setCellValue("修改时间");
			row.createCell(48).setCellValue("修改人");
			row.createCell(49).setCellValue("输入时间");
			row.createCell(50).setCellValue("输入人 ");		
			
			row.createCell(51).setCellValue("114");
			row.createCell(52).setCellValue("360 ");	
			
			int r=0;
			for ( i = k; i < resultList.size()&&i<k+num; i++,r++) {					
				HSSFRow data_row = sheet.createRow(r+1);			
			   Map result = (Map)resultList.get(i);	 		 
				data_row.createCell(0).setCellValue(result.get("PROD_CLASS_CODE1")!=null?result.get("PROD_CLASS_CODE1").toString():"");					
				data_row.createCell(1).setCellValue(result.get("PROD_CLASS_NAME1")!=null?result.get("PROD_CLASS_NAME1").toString():"");
				data_row.createCell(2).setCellValue(result.get("PROD_CLASS_CODE2")!=null?result.get("PROD_CLASS_CODE2").toString():"");
				data_row.createCell(3).setCellValue(result.get("PROD_CLASS_NAME2")!=null?result.get("PROD_CLASS_NAME2").toString():"");
				data_row.createCell(4).setCellValue(result.get("CUST_ID")!=null?result.get("CUST_ID").toString():"");
				data_row.createCell(5).setCellValue(result.get("GROUP_ID")!=null?result.get("GROUP_ID").toString():"");
				data_row.createCell(6).setCellValue(result.get("NAME1")!=null?result.get("NAME1").toString():"");
				data_row.createCell(7).setCellValue(result.get("NAME2")!=null?result.get("NAME2").toString():"");
				
				data_row.createCell(8).setCellValue(result.get("SUBNAME1")!=null?result.get("SUBNAME1").toString():"");
				data_row.createCell(9).setCellValue(result.get("SUBNAME2")!=null?result.get("SUBNAME2").toString():"");
				data_row.createCell(10).setCellValue(result.get("SUBNAME3")!=null?result.get("SUBNAME3").toString():"");
				data_row.createCell(11).setCellValue(result.get("SUBNAME4")!=null?result.get("SUBNAME4").toString():"");
				
				data_row.createCell(12).setCellValue(result.get("AREA_CODE")!=null?result.get("AREA_CODE").toString():"");
				data_row.createCell(13).setCellValue(result.get("TEL")!=null?result.get("TEL").toString():"");
				data_row.createCell(14).setCellValue(result.get("TEL_EXT")!=null?result.get("TEL_EXT").toString():"");		
				
				data_row.createCell(15).setCellValue(result.get("FAX_FLAG")!=null?result.get("FAX_FLAG").toString():"");
				data_row.createCell(16).setCellValue(result.get("SB")!=null?result.get("SB").toString():"");	
				
				data_row.createCell(17).setCellValue(result.get("LIST_ORDER")!=null?result.get("LIST_ORDER").toString():"");
				data_row.createCell(18).setCellValue(result.get("REGION_CODE")!=null?result.get("REGION_CODE").toString():"");
				data_row.createCell(19).setCellValue(result.get("REGION_NAME")!=null?result.get("REGION_NAME").toString():"");
				data_row.createCell(20).setCellValue(result.get("CITY_CODE")!=null?result.get("CITY_CODE").toString():"");
				data_row.createCell(21).setCellValue(result.get("CITY_NAME")!=null?result.get("CITY_NAME").toString():"");
				
				data_row.createCell(22).setCellValue(result.get("DESTRICT_CODE")!=null?result.get("DESTRICT_CODE").toString():"");
				data_row.createCell(23).setCellValue(result.get("DESTRICT_NAME")!=null?result.get("DESTRICT_NAME").toString():"");
				
				data_row.createCell(24).setCellValue(result.get("ADDR")!=null?result.get("ADDR").toString():"");
				data_row.createCell(25).setCellValue(result.get("ZIP")!=null?result.get("ZIP").toString():"");
				
				data_row.createCell(26).setCellValue(result.get("PY_ADDR")!=null?result.get("PY_ADDR").toString():"");
				data_row.createCell(27).setCellValue(result.get("ENG_ADDR")!=null?result.get("ENG_ADDR").toString():"");
				data_row.createCell(28).setCellValue(result.get("POIX")!=null?result.get("POIX").toString():"");
				data_row.createCell(29).setCellValue(result.get("POIY")!=null?result.get("POIY").toString():"");
				
				data_row.createCell(30).setCellValue(result.get("CUST_STATUS")!=null?result.get("CUST_STATUS").toString():"");
				
				data_row.createCell(31).setCellValue(result.get("CUST_TYPE_CODE")!=null?result.get("CUST_TYPE_CODE").toString():"");
				data_row.createCell(32).setCellValue(result.get("CLASS_MAIN_ID")!=null?result.get("CLASS_MAIN_ID").toString():"");
				data_row.createCell(33).setCellValue(result.get("ORG_ID")!=null?result.get("ORG_ID").toString():"");
				
				data_row.createCell(34).setCellValue(result.get("URL")!=null?result.get("URL").toString():"");
				data_row.createCell(35).setCellValue(result.get("WEIBO")!=null?result.get("WEIBO").toString():"");		
				data_row.createCell(36).setCellValue(result.get("WEIXIN")!=null?result.get("WEIXIN").toString():"");
				data_row.createCell(37).setCellValue(result.get("YIXIN")!=null?result.get("YIXIN").toString():"");
				
				data_row.createCell(38).setCellValue(result.get("LOGO")!=null?result.get("LOGO").toString():"");
				data_row.createCell(39).setCellValue(result.get("SAFE_STATUS")!=null?result.get("SAFE_STATUS").toString():"");
				data_row.createCell(40).setCellValue(result.get("BX_NAME")!=null?result.get("BX_NAME").toString():"");		
				data_row.createCell(41).setCellValue(result.get("ENG_NAME")!=null?result.get("ENG_NAME").toString():"");
				
				data_row.createCell(42).setCellValue(result.get("SOURCE")!=null?result.get("SOURCE").toString():"");
				
				data_row.createCell(43).setCellValue(result.get("SOURCE_ID")!=null?result.get("SOURCE_ID").toString():"");
				data_row.createCell(44).setCellValue(result.get("PROD_CLASS_ID")!=null?result.get("PROD_CLASS_ID").toString():"");
				
				data_row.createCell(45).setCellValue(result.get("PY_NAME")!=null?result.get("PY_NAME").toString():"");
				data_row.createCell(46).setCellValue(result.get("SP_NAME")!=null?result.get("SP_NAME").toString():"");				
				data_row.createCell(47).setCellValue(result.get("MODIFY_TIME")!=null?result.get("MODIFY_TIME").toString():"");
				data_row.createCell(48).setCellValue(result.get("MODIFY_EMP_CODE")!=null?result.get("MODIFY_EMP_CODE").toString():"");
				data_row.createCell(49).setCellValue(result.get("INPUT_TIME")!=null?result.get("INPUT_TIME").toString():"");
				data_row.createCell(50).setCellValue(result.get("INPUT_EMP_CODE")!=null?result.get("INPUT_EMP_CODE").toString():"");
				
				data_row.createCell(51).setCellValue(result.get("STATUS_114YP")!=null?result.get("STATUS_114YP").toString():"");
				data_row.createCell(52).setCellValue(result.get("STATUS_360")!=null?result.get("STATUS_360").toString():"");
				
				}
				workbook.write(fos);
				srcfile.add(new File(path + folder + "\\ProdCustomer"+(k+1)+"-"+last+".csv"));
				response.flushBuffer();
				fos.close();
				this.addActionMessage("导出ProdCustomer完成");
			}
			}
			/**
			 * ProdGroup导出
			 */		
			FileOutputStream fos2 = null;
			ProdGroupresultList = prodGroupService.ProdGroupexcel(queryMap);
			int ProdGroupsize = ProdGroupresultList.size();
			if (ProdGroupsize ==0) {
				this.addActionError("** ProdGroupsize无数据 !");
				ProdGroupisnull = true;
			}else{
			int count2 = (int) Math.ceil((ProdGroupsize / num) + 1);
			int i2;
			int k2 = 0 + (pagenum - 1) * num;
			int last2;
			if(pagenum==count2){
				last2=ProdGroupsize;
			}else {
				last2=num*pagenum;
			}
			if (pagenum > count2) {
				this.addActionError("** ProdGroup此页无数据 !");
				ProdGroupisnull = true;
			} else {
				fos2 = new FileOutputStream(path + folder + "\\ProdGroup"+(k2+1)+"-"+last2+".csv");
				HSSFWorkbook workbook = new HSSFWorkbook();
				HSSFSheet ProdGroupsheet = workbook.createSheet("ProdGroup");
				ProdGroupsheet.setDefaultColumnWidth(15);
			HSSFRow ProdGrouprow = ProdGroupsheet.createRow(0);					 
			ProdGrouprow.createCell(0).setCellValue("一级分类编号 ");	
			ProdGrouprow.createCell(1).setCellValue("一级分类名称 ");
			ProdGrouprow.createCell(2).setCellValue("二级分类编号 ");
			ProdGrouprow.createCell(3).setCellValue("二级分类名称 ");
			ProdGrouprow.createCell(4).setCellValue("品牌编号 ");
			ProdGrouprow.createCell(5).setCellValue("品牌名称1 ");
			ProdGrouprow.createCell(6).setCellValue("品牌名称2 ");
			
			ProdGrouprow.createCell(7).setCellValue("一级分列名 ");
			ProdGrouprow.createCell(8).setCellValue("二级分列名 ");
			ProdGrouprow.createCell(9).setCellValue("三级分列名 ");
			ProdGrouprow.createCell(10).setCellValue("四级分列名 ");
			
			ProdGrouprow.createCell(11).setCellValue("区号 ");
			ProdGrouprow.createCell(12).setCellValue("电话 ");
			ProdGrouprow.createCell(13).setCellValue("分机 ");
			
			ProdGrouprow.createCell(14).setCellValue("电话2 ");
			ProdGrouprow.createCell(15).setCellValue("电话3 ");
			ProdGrouprow.createCell(16).setCellValue("电话4 ");
			ProdGrouprow.createCell(17).setCellValue("传真标志 ");
			ProdGrouprow.createCell(18).setCellValue("总机标志 ");
			
			ProdGrouprow.createCell(19).setCellValue("地区代码 ");
			ProdGrouprow.createCell(20).setCellValue("地区名称 ");
			ProdGrouprow.createCell(21).setCellValue("城市代码 ");
			ProdGrouprow.createCell(22).setCellValue("城市名称 ");			
			ProdGrouprow.createCell(23).setCellValue("区代码 ");
			ProdGrouprow.createCell(24).setCellValue("区名称 ");			
			ProdGrouprow.createCell(25).setCellValue("地址 ");
			ProdGrouprow.createCell(26).setCellValue("邮编 ");
			
			ProdGrouprow.createCell(27).setCellValue("地址首拼音 ");
			ProdGrouprow.createCell(28).setCellValue("英文地址 ");
			
			ProdGrouprow.createCell(29).setCellValue("Poix ");
			ProdGrouprow.createCell(30).setCellValue("Poiy ");
			
			ProdGrouprow.createCell(31).setCellValue("客户状态 ");
			ProdGrouprow.createCell(32).setCellValue("客户类型 ");
			ProdGrouprow.createCell(33).setCellValue("分类主ID ");
			ProdGrouprow.createCell(34).setCellValue("ORGID ");
			
			ProdGrouprow.createCell(35).setCellValue("Url ");	
			ProdGrouprow.createCell(36).setCellValue("列名次序 ");
			
			ProdGrouprow.createCell(37).setCellValue("微博名 ");
			
			ProdGrouprow.createCell(38).setCellValue("微博 ");
			ProdGrouprow.createCell(39).setCellValue("微信 ");
			ProdGrouprow.createCell(40).setCellValue("易信 ");
			
			ProdGrouprow.createCell(41).setCellValue("LOGO ");
			ProdGrouprow.createCell(42).setCellValue("安全状态 ");
			ProdGrouprow.createCell(43).setCellValue("笔序 ");
			ProdGrouprow.createCell(44).setCellValue("拼音 ");
			ProdGrouprow.createCell(45).setCellValue("英文名 ");
			ProdGrouprow.createCell(46).setCellValue("首拼 ");
			ProdGrouprow.createCell(47).setCellValue("分类ID ");
			
			ProdGrouprow.createCell(48).setCellValue("修改时间 ");
			ProdGrouprow.createCell(49).setCellValue("修改人 ");
			ProdGrouprow.createCell(50).setCellValue("输入时间 ");
			ProdGrouprow.createCell(51).setCellValue("输入人 ");	
			 int r2=0;
			for ( i2 = k2; i2 < ProdGroupresultList.size()&&i2<k2+num; i2++,r2++) {			
				HSSFRow ProdGroupdata_row = ProdGroupsheet.createRow(r2+1);			
			   Map ProdGroupresult = (Map)ProdGroupresultList.get(i2);	 		 
			   ProdGroupdata_row.createCell(0).setCellValue(ProdGroupresult.get("PROD_CLASS_CODE1")!=null?ProdGroupresult.get("PROD_CLASS_CODE1").toString():"");					
			   ProdGroupdata_row.createCell(1).setCellValue(ProdGroupresult.get("PROD_CLASS_NAME1")!=null?ProdGroupresult.get("PROD_CLASS_NAME1").toString():"");
			   ProdGroupdata_row.createCell(2).setCellValue(ProdGroupresult.get("PROD_CLASS_CODE2")!=null?ProdGroupresult.get("PROD_CLASS_CODE2").toString():"");
			   ProdGroupdata_row.createCell(3).setCellValue(ProdGroupresult.get("PROD_CLASS_NAME2")!=null?ProdGroupresult.get("PROD_CLASS_NAME2").toString():"");
			   ProdGroupdata_row.createCell(4).setCellValue(ProdGroupresult.get("GROUP_ID")!=null?ProdGroupresult.get("GROUP_ID").toString():"");
			   ProdGroupdata_row.createCell(5).setCellValue(ProdGroupresult.get("NAME1")!=null?ProdGroupresult.get("NAME1").toString():"");
			   ProdGroupdata_row.createCell(6).setCellValue(ProdGroupresult.get("NAME2")!=null?ProdGroupresult.get("NAME2").toString():"");		
			   
			   ProdGroupdata_row.createCell(7).setCellValue(ProdGroupresult.get("SUBNAME1")!=null?ProdGroupresult.get("SUBNAME1").toString():"");
			   ProdGroupdata_row.createCell(8).setCellValue(ProdGroupresult.get("SUBNAME2")!=null?ProdGroupresult.get("SUBNAME2").toString():"");
			   ProdGroupdata_row.createCell(9).setCellValue(ProdGroupresult.get("SUBNAME3")!=null?ProdGroupresult.get("SUBNAME3").toString():"");
			   ProdGroupdata_row.createCell(10).setCellValue(ProdGroupresult.get("SUBNAME4")!=null?ProdGroupresult.get("SUBNAME4").toString():"");
			   
			   ProdGroupdata_row.createCell(11).setCellValue(ProdGroupresult.get("AREA_CODE")!=null?ProdGroupresult.get("AREA_CODE").toString():"");
			   ProdGroupdata_row.createCell(12).setCellValue(ProdGroupresult.get("TEL")!=null?ProdGroupresult.get("TEL").toString():"");
			   ProdGroupdata_row.createCell(13).setCellValue(ProdGroupresult.get("TEL_EXT")!=null?ProdGroupresult.get("TEL_EXT").toString():"");			
			   
			   ProdGroupdata_row.createCell(14).setCellValue(ProdGroupresult.get("TEL2")!=null?ProdGroupresult.get("TEL2").toString():"");
			   ProdGroupdata_row.createCell(15).setCellValue(ProdGroupresult.get("TEL3")!=null?ProdGroupresult.get("TEL3").toString():"");
			   ProdGroupdata_row.createCell(16).setCellValue(ProdGroupresult.get("TEL4")!=null?ProdGroupresult.get("TEL4").toString():"");
			   ProdGroupdata_row.createCell(17).setCellValue(ProdGroupresult.get("FAX_FLAG")!=null?ProdGroupresult.get("FAX_FLAG").toString():"");
			   ProdGroupdata_row.createCell(18).setCellValue(ProdGroupresult.get("SB")!=null?ProdGroupresult.get("SB").toString():"");
			   
			   ProdGroupdata_row.createCell(19).setCellValue(ProdGroupresult.get("REGION_CODE")!=null?ProdGroupresult.get("REGION_CODE").toString():"");		
			   ProdGroupdata_row.createCell(20).setCellValue(ProdGroupresult.get("REGION_NAME")!=null?ProdGroupresult.get("REGION_NAME").toString():"");
			   ProdGroupdata_row.createCell(21).setCellValue(ProdGroupresult.get("CITY_CODE")!=null?ProdGroupresult.get("CITY_CODE").toString():"");
			   ProdGroupdata_row.createCell(22).setCellValue(ProdGroupresult.get("CITY_NAME")!=null?ProdGroupresult.get("CITY_NAME").toString():"");				
			   ProdGroupdata_row.createCell(23).setCellValue(ProdGroupresult.get("DESTRICT_CODE")!=null?ProdGroupresult.get("DESTRICT_CODE").toString():"");
			   ProdGroupdata_row.createCell(24).setCellValue(ProdGroupresult.get("DESTRICT_NAME")!=null?ProdGroupresult.get("DESTRICT_NAME").toString():"");				
			   ProdGroupdata_row.createCell(25).setCellValue(ProdGroupresult.get("ADDR")!=null?ProdGroupresult.get("ADDR").toString():"");
			   ProdGroupdata_row.createCell(26).setCellValue(ProdGroupresult.get("ZIP")!=null?ProdGroupresult.get("ZIP").toString():"");			
			  
			   ProdGroupdata_row.createCell(27).setCellValue(ProdGroupresult.get("PY_ADDR")!=null?ProdGroupresult.get("PY_ADDR").toString():"");
			   ProdGroupdata_row.createCell(28).setCellValue(ProdGroupresult.get("ENG_ADDR")!=null?ProdGroupresult.get("ENG_ADDR").toString():"");				
			   
			   ProdGroupdata_row.createCell(29).setCellValue(ProdGroupresult.get("POIX")!=null?ProdGroupresult.get("POIX").toString():"");
			   ProdGroupdata_row.createCell(30).setCellValue(ProdGroupresult.get("POIY")!=null?ProdGroupresult.get("POIY").toString():"");	
			   
			   ProdGroupdata_row.createCell(31).setCellValue(ProdGroupresult.get("CUST_STATUS")!=null?ProdGroupresult.get("CUST_STATUS").toString():"");
			   ProdGroupdata_row.createCell(32).setCellValue(ProdGroupresult.get("CUST_TYPE_CODE")!=null?ProdGroupresult.get("CUST_TYPE_CODE").toString():"");	
			   ProdGroupdata_row.createCell(33).setCellValue(ProdGroupresult.get("CLASS_MAIN_ID")!=null?ProdGroupresult.get("CLASS_MAIN_ID").toString():"");
			   ProdGroupdata_row.createCell(34).setCellValue(ProdGroupresult.get("ORG_ID")!=null?ProdGroupresult.get("ORG_ID").toString():"");	
			   
			   ProdGroupdata_row.createCell(35).setCellValue(ProdGroupresult.get("URL")!=null?ProdGroupresult.get("URL").toString():"");
			   ProdGroupdata_row.createCell(36).setCellValue(ProdGroupresult.get("LIST_ORDER")!=null?ProdGroupresult.get("LIST_ORDER").toString():"");				
			   
			   ProdGroupdata_row.createCell(37).setCellValue(ProdGroupresult.get("WEIBO_NAME")!=null?ProdGroupresult.get("WEIBO_NAME").toString():"");
			   
			   ProdGroupdata_row.createCell(38).setCellValue(ProdGroupresult.get("WEIBO")!=null?ProdGroupresult.get("WEIBO").toString():"");
			   ProdGroupdata_row.createCell(39).setCellValue(ProdGroupresult.get("WEIXIN")!=null?ProdGroupresult.get("WEIXIN").toString():"");
			   ProdGroupdata_row.createCell(40).setCellValue(ProdGroupresult.get("YIXIN")!=null?ProdGroupresult.get("YIXIN").toString():"");		
			   
			   ProdGroupdata_row.createCell(41).setCellValue(ProdGroupresult.get("LOGO")!=null?ProdGroupresult.get("LOGO").toString():"");
			   ProdGroupdata_row.createCell(42).setCellValue(ProdGroupresult.get("SAFE_STATUS")!=null?ProdGroupresult.get("WEIBO").toString():"");
			   ProdGroupdata_row.createCell(43).setCellValue(ProdGroupresult.get("BX_NAME")!=null?ProdGroupresult.get("WEIXIN").toString():"");
			   ProdGroupdata_row.createCell(44).setCellValue(ProdGroupresult.get("PY_NAME")!=null?ProdGroupresult.get("YIXIN").toString():"");	
			   ProdGroupdata_row.createCell(45).setCellValue(ProdGroupresult.get("ENG_NAME")!=null?ProdGroupresult.get("WEIBO").toString():"");
			   ProdGroupdata_row.createCell(46).setCellValue(ProdGroupresult.get("SP_NAME")!=null?ProdGroupresult.get("WEIXIN").toString():"");
			   ProdGroupdata_row.createCell(47).setCellValue(ProdGroupresult.get("PROD_CLASS_ID")!=null?ProdGroupresult.get("YIXIN").toString():"");		
			   
			   ProdGroupdata_row.createCell(48).setCellValue(ProdGroupresult.get("MODIFY_TIME")!=null?ProdGroupresult.get("MODIFY_TIME").toString():"");
			   ProdGroupdata_row.createCell(49).setCellValue(ProdGroupresult.get("MODIFY_EMP_ID")!=null?ProdGroupresult.get("MODIFY_EMP_ID").toString():"");
			   ProdGroupdata_row.createCell(50).setCellValue(ProdGroupresult.get("INPUT_TIME")!=null?ProdGroupresult.get("INPUT_TIME").toString():"");
			   ProdGroupdata_row.createCell(51).setCellValue(ProdGroupresult.get("INPUT_EMP_ID")!=null?ProdGroupresult.get("INPUT_EMP_ID").toString():"");
				}
				workbook.write(fos2);
				srcfile.add(new File(path + folder + "\\ProdGroup"+(k2+1)+"-"+last2+".csv"));
				response.flushBuffer();
				fos2.close();
				this.addActionMessage("导出ProdGroup完成");
			}	
			}
			/**
				 *  ProdClass导出
				 */	
			FileOutputStream fos3 = null;
			ProdClassresultList = prodClassService.ProdClassexcel(queryMap);
			int ProdClasssize = ProdClassresultList.size();
			if (ProdClasssize ==0) {
				this.addActionError("** ProdClasssize无数据 !");
				ProdClassisnull = true;
			}else{
			int count3 = (int) Math.ceil((ProdClasssize / num) + 1);
			int i3;
			int k3 = 0 + (pagenum - 1) * num;
			int last3;
			if(pagenum==count3){
				last3=ProdClasssize;
			}else {
				last3=num*pagenum;
			}
			if (pagenum > count3) {
				this.addActionError("** ProdClass此页无数据 !");
				ProdClassisnull = true;
			} else {
			fos3 = new FileOutputStream(path+folder+"\\ProdClass"+(k3+1)+"-"+last3+".csv");
			HSSFWorkbook workbook = new HSSFWorkbook();	
			HSSFSheet ProdClasssheet = workbook.createSheet("ProdClass");	
			ProdClasssheet.setDefaultColumnWidth(15);
			HSSFRow ProdClassrow = ProdClasssheet.createRow(0);					 
			ProdClassrow.createCell(0).setCellValue("层级和次序 ");	
			ProdClassrow.createCell(1).setCellValue("分类ID ");
			ProdClassrow.createCell(2).setCellValue("城市代码 ");
			ProdClassrow.createCell(3).setCellValue("城市名称 ");
			ProdClassrow.createCell(4).setCellValue("英文分类名 ");
			ProdClassrow.createCell(5).setCellValue("分类名称首拼 ");
			ProdClassrow.createCell(6).setCellValue("分类名称笔序 ");
			ProdClassrow.createCell(7).setCellValue("备注 ");
			ProdClassrow.createCell(8).setCellValue("分类名称 ");
			ProdClassrow.createCell(9).setCellValue("类型 ");
			ProdClassrow.createCell(10).setCellValue("状态 ");
			ProdClassrow.createCell(11).setCellValue("分类编号 ");
			int r3=0;
			for ( i3 = k3; i3 < ProdClassresultList.size()&&i3<k3+num; i3++,r3++) {			
				HSSFRow ProdClassdata_row = ProdClasssheet.createRow(r3+1);				
			   Map ProdClassresult = (Map)ProdClassresultList.get(i3);	 		 
			   ProdClassdata_row.createCell(0).setCellValue(ProdClassresult.get("LINE")!=null?ProdClassresult.get("LINE").toString():"");					
			   ProdClassdata_row.createCell(1).setCellValue(ProdClassresult.get("CLASS_ID")!=null?ProdClassresult.get("CLASS_ID").toString():"");
			   ProdClassdata_row.createCell(2).setCellValue(ProdClassresult.get("CITY_CODE")!=null?ProdClassresult.get("CITY_CODE").toString():"");
			   ProdClassdata_row.createCell(3).setCellValue(ProdClassresult.get("CITY_NAME")!=null?ProdClassresult.get("CITY_NAME").toString():"");
			   ProdClassdata_row.createCell(4).setCellValue(ProdClassresult.get("ENG_NAME")!=null?ProdClassresult.get("ENG_NAME").toString():"");
			   ProdClassdata_row.createCell(5).setCellValue(ProdClassresult.get("PY_NAME")!=null?ProdClassresult.get("PY_NAME").toString():"");
			   ProdClassdata_row.createCell(6).setCellValue(ProdClassresult.get("BX_NAME")!=null?ProdClassresult.get("BX_NAME").toString():"");
			   ProdClassdata_row.createCell(7).setCellValue(ProdClassresult.get("NOTE")!=null?ProdClassresult.get("NOTE").toString():"");
			   ProdClassdata_row.createCell(8).setCellValue(ProdClassresult.get("NAME")!=null?ProdClassresult.get("NAME").toString():"");
			   ProdClassdata_row.createCell(9).setCellValue(ProdClassresult.get("TYPE")!=null?ProdClassresult.get("TYPE").toString():"");		
			   ProdClassdata_row.createCell(10).setCellValue(ProdClassresult.get("STATUS")!=null?ProdClassresult.get("STATUS").toString():"");
			   ProdClassdata_row.createCell(11).setCellValue(ProdClassresult.get("CODE")!=null?ProdClassresult.get("CODE").toString():"");
				}
				workbook.write(fos3);
				srcfile.add(new File(path + folder + "\\ProdClass"+(k3+1)+"-"+last3+".csv"));
				response.flushBuffer();
				fos3.close();
				this.addActionMessage("导出ProdClass完成");
			}
			}
			/**
				 *  ManageRegion导出
				 */	
			FileOutputStream fos4 = null;
		    queryMap.put("regionCode", query_cityCode);
    	    queryMap.put("name", query_cityName);
			ManageRegionresultList = manageRegionService
					.ManageRegionexcel(queryMap);
			int ManageRegionsize = ManageRegionresultList.size();
			if (ManageRegionsize ==0) {
				this.addActionError("** ManageRegionsize无数据 !");
				ManageRegionisnull = true;
			}else{
			int count4 = (int) Math.ceil((ManageRegionsize / num) + 1);
			int i4;
			int k4 = 0 + (pagenum - 1) * num;
			int last4;
			if(pagenum==count4){
				last4=ManageRegionsize;
			}else {
				last4=num*pagenum;
			}
			if (pagenum > count4) {
				this.addActionError("** ManageRegion此页无数据 !");
				ManageRegionisnull = true;
			} else {
			fos4 = new FileOutputStream(path+folder+"\\ManageRegion"+(k4+1)+"-"+last4+".csv");
			HSSFWorkbook workbook = new HSSFWorkbook();	
			HSSFSheet ManageRegionsheet = workbook.createSheet("ManageRegion");	
			ManageRegionsheet.setDefaultColumnWidth(15);
			HSSFRow ManageRegionrow = ManageRegionsheet.createRow(0);					 
			ManageRegionrow.createCell(0).setCellValue("地区代码 ");	
			ManageRegionrow.createCell(1).setCellValue("短名称 ");
			ManageRegionrow.createCell(2).setCellValue("英文名 ");
			ManageRegionrow.createCell(3).setCellValue("电话位数 ");
			ManageRegionrow.createCell(4).setCellValue("区号 ");
			ManageRegionrow.createCell(5).setCellValue("简称 ");
			ManageRegionrow.createCell(6).setCellValue("备注 ");
			ManageRegionrow.createCell(7).setCellValue("名称 ");
			int r4=0;
			for ( i4 = k4; i4 < ManageRegionresultList.size()&&i4<k4+num; i4++,r4++) {					
				HSSFRow ManageRegiondata_row = ManageRegionsheet.createRow(r4+1);			
			   Map ManageRegionresult = (Map)ManageRegionresultList.get(i4);	 		 
			   ManageRegiondata_row.createCell(0).setCellValue(ManageRegionresult.get("REGION_CODE")!=null?ManageRegionresult.get("REGION_CODE").toString():"");					
			   ManageRegiondata_row.createCell(1).setCellValue(ManageRegionresult.get("SHORT_NAME")!=null?ManageRegionresult.get("SHORT_NAME").toString():"");
			   ManageRegiondata_row.createCell(2).setCellValue(ManageRegionresult.get("ENG_NAME")!=null?ManageRegionresult.get("ENG_NAME").toString():"");
			   ManageRegiondata_row.createCell(3).setCellValue(ManageRegionresult.get("TEL_LENGTH")!=null?ManageRegionresult.get("TEL_LENGTH").toString():"");
			   ManageRegiondata_row.createCell(4).setCellValue(ManageRegionresult.get("AREA_CODE")!=null?ManageRegionresult.get("AREA_CODE").toString():"");
			   ManageRegiondata_row.createCell(5).setCellValue(ManageRegionresult.get("ABBR_NAME")!=null?ManageRegionresult.get("ABBR_NAME").toString():"");
			   ManageRegiondata_row.createCell(6).setCellValue(ManageRegionresult.get("NOTE")!=null?ManageRegionresult.get("NOTE").toString():"");
			   ManageRegiondata_row.createCell(7).setCellValue(ManageRegionresult.get("NAME")!=null?ManageRegionresult.get("NAME").toString():"");
				}	
				workbook.write(fos4);
				srcfile.add(new File(path + folder + "\\ManageRegion"+(k4+1)+"-"+last4+".csv"));
				response.flushBuffer();
				fos4.close();
				this.addActionMessage("导出ManageRegion完成");
			}
			}
			if (ProdCustomerisnull == true && ProdGroupisnull == true
					& ProdClassisnull == true & ManageRegionisnull == true) {
				todownloadcsv = "";
				this.addActionMessage("请重新导出数据");
			} else {
				todownloadcsv = "";
				File zipfile = new File(path + folder + ".zip");
				this.zipFiles(srcfile, zipfile);
				todownloadcsv = "window.open('db_ndc_csv.zip');";
			}
		} catch (Exception e) {
				log.error(e.getMessage(), e);
				this.addActionError("** 生成文件错误 !");
				
			} finally {
				if (fos != null) {
					try {
						//outp.close();
						fos.close();

					} catch (IOException e) {
						log.error(e.getMessage(), e);
					}
				}
			}	
			
			return RESULT_QUERY;
		}	
	
	public String exportDBF() {	

		List<File> srcfile=new ArrayList<File>();  
		HttpServletRequest request = ServletActionContext.getRequest();
		HttpServletResponse response = ServletActionContext.getResponse();
		response.setContentType( "text/html;charset=GBK "); 
		String path = request.getSession().getServletContext().getRealPath("");
		path = path.replace("\\","//");
		FileOutputStream fos=null;
		String folder="/db_ndc_dbf";
		 File file = new File(path+folder);  
		        if(!file.exists()){  
		            file.mkdir();  
		        }  

			try {

			/**
			 * ProdCustomer导出 
			 */
			boolean ProdCustomerisnull = false;
			boolean ProdGroupisnull = false;
			boolean ProdClassisnull = false;
			boolean ManageRegionisnull = false;
			Map queryMap = new HashMap();
			
			queryMap.put("cityCode", query_cityCode);
			queryMap.put("cityName", query_cityName);
			System.out.print(query_cityName);
			resultList = prodCustomerService.ProdCustomerexcel(queryMap);
			int resultListsize=resultList.size();		
			if (resultListsize ==0) {
				this.addActionError("** ProdCustomer无数据 !");
				ProdCustomerisnull = true;
			}else{
			int count = (int) Math.ceil((resultListsize / num) + 1);
			int i;
			int k = 0 + (pagenum - 1) * num;
			int last;
			if(pagenum==count){
				last=resultListsize;
			}else {
				last=num*pagenum;
			}
			if (pagenum > count) {
				this.addActionError("** ProdCustomer此页无数据 !");
				ProdCustomerisnull = true;
			} else {
				fos = new FileOutputStream(path + folder + "\\ProdCustomer"+(k+1)+"-"+last+".dbf");
				HSSFWorkbook workbook = new HSSFWorkbook();
				HSSFSheet sheet = workbook.createSheet("ProdCustomer");
				sheet.setDefaultColumnWidth(15);
				HSSFRow row = sheet.createRow(0);			 
			row.createCell(0).setCellValue("一级分类编号 ");	
			row.createCell(1).setCellValue("一级分类名称 ");
			row.createCell(2).setCellValue("二级分类编号 ");
			row.createCell(3).setCellValue("二级分类名称 ");
			row.createCell(4).setCellValue("客户编号 ");
			row.createCell(5).setCellValue("品牌编号 ");
			row.createCell(6).setCellValue("客户名称1 ");
			row.createCell(7).setCellValue("客户名称2");
			
			row.createCell(8).setCellValue("一级分列名 ");
			row.createCell(9).setCellValue("二级分列名 ");
			row.createCell(10).setCellValue("三级分列名 ");
			row.createCell(11).setCellValue("四级分列名");
			
			row.createCell(12).setCellValue("区号");
			
			row.createCell(13).setCellValue("电话");
			row.createCell(14).setCellValue("分机");
			
			row.createCell(15).setCellValue("传真标志");
			row.createCell(16).setCellValue("总机标志");
			
			row.createCell(17).setCellValue("列名次序");
			row.createCell(18).setCellValue("地区代码");
			row.createCell(19).setCellValue("地区名称");
			row.createCell(20).setCellValue("城市代码");
			row.createCell(21).setCellValue("城市名称");
			
			row.createCell(22).setCellValue("区域代码");
			row.createCell(23).setCellValue("区域名称");
			
			row.createCell(24).setCellValue("地址");
			row.createCell(25).setCellValue("邮编");
			
			row.createCell(26).setCellValue("地址首拼音");
			row.createCell(27).setCellValue("英文地址");
			row.createCell(28).setCellValue("纬度");
			row.createCell(29).setCellValue("经度");
			
			row.createCell(30).setCellValue("客户状态");
			
			row.createCell(31).setCellValue("客户类型");
			row.createCell(32).setCellValue("分类主ID");
			row.createCell(33).setCellValue("ORGID");
			
			row.createCell(34).setCellValue("Url");
			row.createCell(35).setCellValue("微博");
			row.createCell(36).setCellValue("微信");	
			row.createCell(37).setCellValue("易信");
			
			row.createCell(38).setCellValue("LOGO");
			row.createCell(39).setCellValue("安全状态");
			row.createCell(40).setCellValue("笔序");
			row.createCell(41).setCellValue("英文名");
			
			row.createCell(42).setCellValue("来源");
			
			row.createCell(43).setCellValue("来源ID");
			row.createCell(44).setCellValue("分类ID");
			
			row.createCell(45).setCellValue("拼音");
			row.createCell(46).setCellValue("首拼");
			row.createCell(47).setCellValue("修改时间");
			row.createCell(48).setCellValue("修改人");
			row.createCell(49).setCellValue("输入时间");
			row.createCell(50).setCellValue("输入人 ");		
			
			row.createCell(51).setCellValue("114");
			row.createCell(52).setCellValue("360 ");	
			
			int r=0;
			for ( i = k; i < resultList.size()&&i<k+num; i++,r++) {					
				HSSFRow data_row = sheet.createRow(r+1);			
			   Map result = (Map)resultList.get(i);	 		 
				data_row.createCell(0).setCellValue(result.get("PROD_CLASS_CODE1")!=null?result.get("PROD_CLASS_CODE1").toString():"");					
				data_row.createCell(1).setCellValue(result.get("PROD_CLASS_NAME1")!=null?result.get("PROD_CLASS_NAME1").toString():"");
				data_row.createCell(2).setCellValue(result.get("PROD_CLASS_CODE2")!=null?result.get("PROD_CLASS_CODE2").toString():"");
				data_row.createCell(3).setCellValue(result.get("PROD_CLASS_NAME2")!=null?result.get("PROD_CLASS_NAME2").toString():"");
				data_row.createCell(4).setCellValue(result.get("CUST_ID")!=null?result.get("CUST_ID").toString():"");
				data_row.createCell(5).setCellValue(result.get("GROUP_ID")!=null?result.get("GROUP_ID").toString():"");
				data_row.createCell(6).setCellValue(result.get("NAME1")!=null?result.get("NAME1").toString():"");
				data_row.createCell(7).setCellValue(result.get("NAME2")!=null?result.get("NAME2").toString():"");
				
				data_row.createCell(8).setCellValue(result.get("SUBNAME1")!=null?result.get("SUBNAME1").toString():"");
				data_row.createCell(9).setCellValue(result.get("SUBNAME2")!=null?result.get("SUBNAME2").toString():"");
				data_row.createCell(10).setCellValue(result.get("SUBNAME3")!=null?result.get("SUBNAME3").toString():"");
				data_row.createCell(11).setCellValue(result.get("SUBNAME4")!=null?result.get("SUBNAME4").toString():"");
				
				data_row.createCell(12).setCellValue(result.get("AREA_CODE")!=null?result.get("AREA_CODE").toString():"");
				data_row.createCell(13).setCellValue(result.get("TEL")!=null?result.get("TEL").toString():"");
				data_row.createCell(14).setCellValue(result.get("TEL_EXT")!=null?result.get("TEL_EXT").toString():"");		
				
				data_row.createCell(15).setCellValue(result.get("FAX_FLAG")!=null?result.get("FAX_FLAG").toString():"");
				data_row.createCell(16).setCellValue(result.get("SB")!=null?result.get("SB").toString():"");	
				
				data_row.createCell(17).setCellValue(result.get("LIST_ORDER")!=null?result.get("LIST_ORDER").toString():"");
				data_row.createCell(18).setCellValue(result.get("REGION_CODE")!=null?result.get("REGION_CODE").toString():"");
				data_row.createCell(19).setCellValue(result.get("REGION_NAME")!=null?result.get("REGION_NAME").toString():"");
				data_row.createCell(20).setCellValue(result.get("CITY_CODE")!=null?result.get("CITY_CODE").toString():"");
				data_row.createCell(21).setCellValue(result.get("CITY_NAME")!=null?result.get("CITY_NAME").toString():"");
				
				data_row.createCell(22).setCellValue(result.get("DESTRICT_CODE")!=null?result.get("DESTRICT_CODE").toString():"");
				data_row.createCell(23).setCellValue(result.get("DESTRICT_NAME")!=null?result.get("DESTRICT_NAME").toString():"");
				
				data_row.createCell(24).setCellValue(result.get("ADDR")!=null?result.get("ADDR").toString():"");
				data_row.createCell(25).setCellValue(result.get("ZIP")!=null?result.get("ZIP").toString():"");
				
				data_row.createCell(26).setCellValue(result.get("PY_ADDR")!=null?result.get("PY_ADDR").toString():"");
				data_row.createCell(27).setCellValue(result.get("ENG_ADDR")!=null?result.get("ENG_ADDR").toString():"");
				data_row.createCell(28).setCellValue(result.get("POIX")!=null?result.get("POIX").toString():"");
				data_row.createCell(29).setCellValue(result.get("POIY")!=null?result.get("POIY").toString():"");
				
				data_row.createCell(30).setCellValue(result.get("CUST_STATUS")!=null?result.get("CUST_STATUS").toString():"");
				
				data_row.createCell(31).setCellValue(result.get("CUST_TYPE_CODE")!=null?result.get("CUST_TYPE_CODE").toString():"");
				data_row.createCell(32).setCellValue(result.get("CLASS_MAIN_ID")!=null?result.get("CLASS_MAIN_ID").toString():"");
				data_row.createCell(33).setCellValue(result.get("ORG_ID")!=null?result.get("ORG_ID").toString():"");
				
				data_row.createCell(34).setCellValue(result.get("URL")!=null?result.get("URL").toString():"");
				data_row.createCell(35).setCellValue(result.get("WEIBO")!=null?result.get("WEIBO").toString():"");		
				data_row.createCell(36).setCellValue(result.get("WEIXIN")!=null?result.get("WEIXIN").toString():"");
				data_row.createCell(37).setCellValue(result.get("YIXIN")!=null?result.get("YIXIN").toString():"");
				
				data_row.createCell(38).setCellValue(result.get("LOGO")!=null?result.get("LOGO").toString():"");
				data_row.createCell(39).setCellValue(result.get("SAFE_STATUS")!=null?result.get("SAFE_STATUS").toString():"");
				data_row.createCell(40).setCellValue(result.get("BX_NAME")!=null?result.get("BX_NAME").toString():"");		
				data_row.createCell(41).setCellValue(result.get("ENG_NAME")!=null?result.get("ENG_NAME").toString():"");
				
				data_row.createCell(42).setCellValue(result.get("SOURCE")!=null?result.get("SOURCE").toString():"");
				
				data_row.createCell(43).setCellValue(result.get("SOURCE_ID")!=null?result.get("SOURCE_ID").toString():"");
				data_row.createCell(44).setCellValue(result.get("PROD_CLASS_ID")!=null?result.get("PROD_CLASS_ID").toString():"");
				
				data_row.createCell(45).setCellValue(result.get("PY_NAME")!=null?result.get("PY_NAME").toString():"");
				data_row.createCell(46).setCellValue(result.get("SP_NAME")!=null?result.get("SP_NAME").toString():"");				
				data_row.createCell(47).setCellValue(result.get("MODIFY_TIME")!=null?result.get("MODIFY_TIME").toString():"");
				data_row.createCell(48).setCellValue(result.get("MODIFY_EMP_CODE")!=null?result.get("MODIFY_EMP_CODE").toString():"");
				data_row.createCell(49).setCellValue(result.get("INPUT_TIME")!=null?result.get("INPUT_TIME").toString():"");
				data_row.createCell(50).setCellValue(result.get("INPUT_EMP_CODE")!=null?result.get("INPUT_EMP_CODE").toString():"");
				
				data_row.createCell(51).setCellValue(result.get("STATUS_114YP")!=null?result.get("STATUS_114YP").toString():"");
				data_row.createCell(52).setCellValue(result.get("STATUS_360")!=null?result.get("STATUS_360").toString():"");
				
				}
				workbook.write(fos);
				srcfile.add(new File(path + folder + "\\ProdCustomer"+(k+1)+"-"+last+".dbf"));
				response.flushBuffer();
				fos.close();
				this.addActionMessage("导出ProdCustomer完成");
			}
			}
			/**
			 * ProdGroup导出
			 */		
			FileOutputStream fos2 = null;
			ProdGroupresultList = prodGroupService.ProdGroupexcel(queryMap);
			int ProdGroupsize = ProdGroupresultList.size();
			if (ProdGroupsize ==0) {
				this.addActionError("** ProdGroupsize无数据 !");
				ProdGroupisnull = true;
			}else{
			int count2 = (int) Math.ceil((ProdGroupsize / num) + 1);
			int i2;
			int k2 = 0 + (pagenum - 1) * num;
			int last2;
			if(pagenum==count2){
				last2=ProdGroupsize;
			}else {
				last2=num*pagenum;
			}
			if (pagenum > count2) {
				this.addActionError("** ProdGroup此页无数据 !");
				ProdGroupisnull = true;
			} else {
				fos2 = new FileOutputStream(path + folder + "\\ProdGroup"+(k2+1)+"-"+last2+".dbf");
				HSSFWorkbook workbook = new HSSFWorkbook();
				HSSFSheet ProdGroupsheet = workbook.createSheet("ProdGroup");
				ProdGroupsheet.setDefaultColumnWidth(15);
			HSSFRow ProdGrouprow = ProdGroupsheet.createRow(0);					 
			ProdGrouprow.createCell(0).setCellValue("一级分类编号 ");	
			ProdGrouprow.createCell(1).setCellValue("一级分类名称 ");
			ProdGrouprow.createCell(2).setCellValue("二级分类编号 ");
			ProdGrouprow.createCell(3).setCellValue("二级分类名称 ");
			ProdGrouprow.createCell(4).setCellValue("品牌编号 ");
			ProdGrouprow.createCell(5).setCellValue("品牌名称1 ");
			ProdGrouprow.createCell(6).setCellValue("品牌名称2 ");
			
			ProdGrouprow.createCell(7).setCellValue("一级分列名 ");
			ProdGrouprow.createCell(8).setCellValue("二级分列名 ");
			ProdGrouprow.createCell(9).setCellValue("三级分列名 ");
			ProdGrouprow.createCell(10).setCellValue("四级分列名 ");
			
			ProdGrouprow.createCell(11).setCellValue("区号 ");
			ProdGrouprow.createCell(12).setCellValue("电话 ");
			ProdGrouprow.createCell(13).setCellValue("分机 ");
			
			ProdGrouprow.createCell(14).setCellValue("电话2 ");
			ProdGrouprow.createCell(15).setCellValue("电话3 ");
			ProdGrouprow.createCell(16).setCellValue("电话4 ");
			ProdGrouprow.createCell(17).setCellValue("传真标志 ");
			ProdGrouprow.createCell(18).setCellValue("总机标志 ");
			
			ProdGrouprow.createCell(19).setCellValue("地区代码 ");
			ProdGrouprow.createCell(20).setCellValue("地区名称 ");
			ProdGrouprow.createCell(21).setCellValue("城市代码 ");
			ProdGrouprow.createCell(22).setCellValue("城市名称 ");			
			ProdGrouprow.createCell(23).setCellValue("区代码 ");
			ProdGrouprow.createCell(24).setCellValue("区名称 ");			
			ProdGrouprow.createCell(25).setCellValue("地址 ");
			ProdGrouprow.createCell(26).setCellValue("邮编 ");
			
			ProdGrouprow.createCell(27).setCellValue("地址首拼音 ");
			ProdGrouprow.createCell(28).setCellValue("英文地址 ");
			
			ProdGrouprow.createCell(29).setCellValue("Poix ");
			ProdGrouprow.createCell(30).setCellValue("Poiy ");
			
			ProdGrouprow.createCell(31).setCellValue("客户状态 ");
			ProdGrouprow.createCell(32).setCellValue("客户类型 ");
			ProdGrouprow.createCell(33).setCellValue("分类主ID ");
			ProdGrouprow.createCell(34).setCellValue("ORGID ");
			
			ProdGrouprow.createCell(35).setCellValue("Url ");	
			ProdGrouprow.createCell(36).setCellValue("列名次序 ");
			
			ProdGrouprow.createCell(37).setCellValue("微博名 ");
			
			ProdGrouprow.createCell(38).setCellValue("微博 ");
			ProdGrouprow.createCell(39).setCellValue("微信 ");
			ProdGrouprow.createCell(40).setCellValue("易信 ");
			
			ProdGrouprow.createCell(41).setCellValue("LOGO ");
			ProdGrouprow.createCell(42).setCellValue("安全状态 ");
			ProdGrouprow.createCell(43).setCellValue("笔序 ");
			ProdGrouprow.createCell(44).setCellValue("拼音 ");
			ProdGrouprow.createCell(45).setCellValue("英文名 ");
			ProdGrouprow.createCell(46).setCellValue("首拼 ");
			ProdGrouprow.createCell(47).setCellValue("分类ID ");
			
			ProdGrouprow.createCell(48).setCellValue("修改时间 ");
			ProdGrouprow.createCell(49).setCellValue("修改人 ");
			ProdGrouprow.createCell(50).setCellValue("输入时间 ");
			ProdGrouprow.createCell(51).setCellValue("输入人 ");	
			 int r2=0;
			for ( i2 = k2; i2 < ProdGroupresultList.size()&&i2<k2+num; i2++,r2++) {			
				HSSFRow ProdGroupdata_row = ProdGroupsheet.createRow(r2+1);			
			   Map ProdGroupresult = (Map)ProdGroupresultList.get(i2);	 		 
			   ProdGroupdata_row.createCell(0).setCellValue(ProdGroupresult.get("PROD_CLASS_CODE1")!=null?ProdGroupresult.get("PROD_CLASS_CODE1").toString():"");					
			   ProdGroupdata_row.createCell(1).setCellValue(ProdGroupresult.get("PROD_CLASS_NAME1")!=null?ProdGroupresult.get("PROD_CLASS_NAME1").toString():"");
			   ProdGroupdata_row.createCell(2).setCellValue(ProdGroupresult.get("PROD_CLASS_CODE2")!=null?ProdGroupresult.get("PROD_CLASS_CODE2").toString():"");
			   ProdGroupdata_row.createCell(3).setCellValue(ProdGroupresult.get("PROD_CLASS_NAME2")!=null?ProdGroupresult.get("PROD_CLASS_NAME2").toString():"");
			   ProdGroupdata_row.createCell(4).setCellValue(ProdGroupresult.get("GROUP_ID")!=null?ProdGroupresult.get("GROUP_ID").toString():"");
			   ProdGroupdata_row.createCell(5).setCellValue(ProdGroupresult.get("NAME1")!=null?ProdGroupresult.get("NAME1").toString():"");
			   ProdGroupdata_row.createCell(6).setCellValue(ProdGroupresult.get("NAME2")!=null?ProdGroupresult.get("NAME2").toString():"");		
			   
			   ProdGroupdata_row.createCell(7).setCellValue(ProdGroupresult.get("SUBNAME1")!=null?ProdGroupresult.get("SUBNAME1").toString():"");
			   ProdGroupdata_row.createCell(8).setCellValue(ProdGroupresult.get("SUBNAME2")!=null?ProdGroupresult.get("SUBNAME2").toString():"");
			   ProdGroupdata_row.createCell(9).setCellValue(ProdGroupresult.get("SUBNAME3")!=null?ProdGroupresult.get("SUBNAME3").toString():"");
			   ProdGroupdata_row.createCell(10).setCellValue(ProdGroupresult.get("SUBNAME4")!=null?ProdGroupresult.get("SUBNAME4").toString():"");
			   
			   ProdGroupdata_row.createCell(11).setCellValue(ProdGroupresult.get("AREA_CODE")!=null?ProdGroupresult.get("AREA_CODE").toString():"");
			   ProdGroupdata_row.createCell(12).setCellValue(ProdGroupresult.get("TEL")!=null?ProdGroupresult.get("TEL").toString():"");
			   ProdGroupdata_row.createCell(13).setCellValue(ProdGroupresult.get("TEL_EXT")!=null?ProdGroupresult.get("TEL_EXT").toString():"");			
			   
			   ProdGroupdata_row.createCell(14).setCellValue(ProdGroupresult.get("TEL2")!=null?ProdGroupresult.get("TEL2").toString():"");
			   ProdGroupdata_row.createCell(15).setCellValue(ProdGroupresult.get("TEL3")!=null?ProdGroupresult.get("TEL3").toString():"");
			   ProdGroupdata_row.createCell(16).setCellValue(ProdGroupresult.get("TEL4")!=null?ProdGroupresult.get("TEL4").toString():"");
			   ProdGroupdata_row.createCell(17).setCellValue(ProdGroupresult.get("FAX_FLAG")!=null?ProdGroupresult.get("FAX_FLAG").toString():"");
			   ProdGroupdata_row.createCell(18).setCellValue(ProdGroupresult.get("SB")!=null?ProdGroupresult.get("SB").toString():"");
			   
			   ProdGroupdata_row.createCell(19).setCellValue(ProdGroupresult.get("REGION_CODE")!=null?ProdGroupresult.get("REGION_CODE").toString():"");		
			   ProdGroupdata_row.createCell(20).setCellValue(ProdGroupresult.get("REGION_NAME")!=null?ProdGroupresult.get("REGION_NAME").toString():"");
			   ProdGroupdata_row.createCell(21).setCellValue(ProdGroupresult.get("CITY_CODE")!=null?ProdGroupresult.get("CITY_CODE").toString():"");
			   ProdGroupdata_row.createCell(22).setCellValue(ProdGroupresult.get("CITY_NAME")!=null?ProdGroupresult.get("CITY_NAME").toString():"");				
			   ProdGroupdata_row.createCell(23).setCellValue(ProdGroupresult.get("DESTRICT_CODE")!=null?ProdGroupresult.get("DESTRICT_CODE").toString():"");
			   ProdGroupdata_row.createCell(24).setCellValue(ProdGroupresult.get("DESTRICT_NAME")!=null?ProdGroupresult.get("DESTRICT_NAME").toString():"");				
			   ProdGroupdata_row.createCell(25).setCellValue(ProdGroupresult.get("ADDR")!=null?ProdGroupresult.get("ADDR").toString():"");
			   ProdGroupdata_row.createCell(26).setCellValue(ProdGroupresult.get("ZIP")!=null?ProdGroupresult.get("ZIP").toString():"");			
			  
			   ProdGroupdata_row.createCell(27).setCellValue(ProdGroupresult.get("PY_ADDR")!=null?ProdGroupresult.get("PY_ADDR").toString():"");
			   ProdGroupdata_row.createCell(28).setCellValue(ProdGroupresult.get("ENG_ADDR")!=null?ProdGroupresult.get("ENG_ADDR").toString():"");				
			   
			   ProdGroupdata_row.createCell(29).setCellValue(ProdGroupresult.get("POIX")!=null?ProdGroupresult.get("POIX").toString():"");
			   ProdGroupdata_row.createCell(30).setCellValue(ProdGroupresult.get("POIY")!=null?ProdGroupresult.get("POIY").toString():"");	
			   
			   ProdGroupdata_row.createCell(31).setCellValue(ProdGroupresult.get("CUST_STATUS")!=null?ProdGroupresult.get("CUST_STATUS").toString():"");
			   ProdGroupdata_row.createCell(32).setCellValue(ProdGroupresult.get("CUST_TYPE_CODE")!=null?ProdGroupresult.get("CUST_TYPE_CODE").toString():"");	
			   ProdGroupdata_row.createCell(33).setCellValue(ProdGroupresult.get("CLASS_MAIN_ID")!=null?ProdGroupresult.get("CLASS_MAIN_ID").toString():"");
			   ProdGroupdata_row.createCell(34).setCellValue(ProdGroupresult.get("ORG_ID")!=null?ProdGroupresult.get("ORG_ID").toString():"");	
			   
			   ProdGroupdata_row.createCell(35).setCellValue(ProdGroupresult.get("URL")!=null?ProdGroupresult.get("URL").toString():"");
			   ProdGroupdata_row.createCell(36).setCellValue(ProdGroupresult.get("LIST_ORDER")!=null?ProdGroupresult.get("LIST_ORDER").toString():"");				
			   
			   ProdGroupdata_row.createCell(37).setCellValue(ProdGroupresult.get("WEIBO_NAME")!=null?ProdGroupresult.get("WEIBO_NAME").toString():"");
			   
			   ProdGroupdata_row.createCell(38).setCellValue(ProdGroupresult.get("WEIBO")!=null?ProdGroupresult.get("WEIBO").toString():"");
			   ProdGroupdata_row.createCell(39).setCellValue(ProdGroupresult.get("WEIXIN")!=null?ProdGroupresult.get("WEIXIN").toString():"");
			   ProdGroupdata_row.createCell(40).setCellValue(ProdGroupresult.get("YIXIN")!=null?ProdGroupresult.get("YIXIN").toString():"");		
			   
			   ProdGroupdata_row.createCell(41).setCellValue(ProdGroupresult.get("LOGO")!=null?ProdGroupresult.get("LOGO").toString():"");
			   ProdGroupdata_row.createCell(42).setCellValue(ProdGroupresult.get("SAFE_STATUS")!=null?ProdGroupresult.get("WEIBO").toString():"");
			   ProdGroupdata_row.createCell(43).setCellValue(ProdGroupresult.get("BX_NAME")!=null?ProdGroupresult.get("WEIXIN").toString():"");
			   ProdGroupdata_row.createCell(44).setCellValue(ProdGroupresult.get("PY_NAME")!=null?ProdGroupresult.get("YIXIN").toString():"");	
			   ProdGroupdata_row.createCell(45).setCellValue(ProdGroupresult.get("ENG_NAME")!=null?ProdGroupresult.get("WEIBO").toString():"");
			   ProdGroupdata_row.createCell(46).setCellValue(ProdGroupresult.get("SP_NAME")!=null?ProdGroupresult.get("WEIXIN").toString():"");
			   ProdGroupdata_row.createCell(47).setCellValue(ProdGroupresult.get("PROD_CLASS_ID")!=null?ProdGroupresult.get("YIXIN").toString():"");		
			   
			   ProdGroupdata_row.createCell(48).setCellValue(ProdGroupresult.get("MODIFY_TIME")!=null?ProdGroupresult.get("MODIFY_TIME").toString():"");
			   ProdGroupdata_row.createCell(49).setCellValue(ProdGroupresult.get("MODIFY_EMP_ID")!=null?ProdGroupresult.get("MODIFY_EMP_ID").toString():"");
			   ProdGroupdata_row.createCell(50).setCellValue(ProdGroupresult.get("INPUT_TIME")!=null?ProdGroupresult.get("INPUT_TIME").toString():"");
			   ProdGroupdata_row.createCell(51).setCellValue(ProdGroupresult.get("INPUT_EMP_ID")!=null?ProdGroupresult.get("INPUT_EMP_ID").toString():"");
				}
				workbook.write(fos2);
				srcfile.add(new File(path + folder + "\\ProdGroup"+(k2+1)+"-"+last2+".dbf"));
				response.flushBuffer();
				fos2.close();
				this.addActionMessage("导出ProdGroup完成");
			}	
			}
			/**
				 *  ProdClass导出
				 */	
			FileOutputStream fos3 = null;
			ProdClassresultList = prodClassService.ProdClassexcel(queryMap);
			int ProdClasssize = ProdClassresultList.size();
			if (ProdClasssize ==0) {
				this.addActionError("** ProdClasssize无数据 !");
				ProdClassisnull = true;
			}else{
			int count3 = (int) Math.ceil((ProdClasssize / num) + 1);
			int i3;
			int k3 = 0 + (pagenum - 1) * num;
			int last3;
			if(pagenum==count3){
				last3=ProdClasssize;
			}else {
				last3=num*pagenum;
			}
			if (pagenum > count3) {
				this.addActionError("** ProdClass此页无数据 !");
				ProdClassisnull = true;
			} else {
			fos3 = new FileOutputStream(path+folder+"\\ProdClass"+(k3+1)+"-"+last3+".dbf");
			HSSFWorkbook workbook = new HSSFWorkbook();	
			HSSFSheet ProdClasssheet = workbook.createSheet("ProdClass");	
			ProdClasssheet.setDefaultColumnWidth(15);
			HSSFRow ProdClassrow = ProdClasssheet.createRow(0);					 
			ProdClassrow.createCell(0).setCellValue("层级和次序 ");	
			ProdClassrow.createCell(1).setCellValue("分类ID ");
			ProdClassrow.createCell(2).setCellValue("城市代码 ");
			ProdClassrow.createCell(3).setCellValue("城市名称 ");
			ProdClassrow.createCell(4).setCellValue("英文分类名 ");
			ProdClassrow.createCell(5).setCellValue("分类名称首拼 ");
			ProdClassrow.createCell(6).setCellValue("分类名称笔序 ");
			ProdClassrow.createCell(7).setCellValue("备注 ");
			ProdClassrow.createCell(8).setCellValue("分类名称 ");
			ProdClassrow.createCell(9).setCellValue("类型 ");
			ProdClassrow.createCell(10).setCellValue("状态 ");
			ProdClassrow.createCell(11).setCellValue("分类编号 ");
			int r3=0;
			for ( i3 = k3; i3 < ProdClassresultList.size()&&i3<k3+num; i3++,r3++) {			
				HSSFRow ProdClassdata_row = ProdClasssheet.createRow(r3+1);				
			   Map ProdClassresult = (Map)ProdClassresultList.get(i3);	 		 
			   ProdClassdata_row.createCell(0).setCellValue(ProdClassresult.get("LINE")!=null?ProdClassresult.get("LINE").toString():"");					
			   ProdClassdata_row.createCell(1).setCellValue(ProdClassresult.get("CLASS_ID")!=null?ProdClassresult.get("CLASS_ID").toString():"");
			   ProdClassdata_row.createCell(2).setCellValue(ProdClassresult.get("CITY_CODE")!=null?ProdClassresult.get("CITY_CODE").toString():"");
			   ProdClassdata_row.createCell(3).setCellValue(ProdClassresult.get("CITY_NAME")!=null?ProdClassresult.get("CITY_NAME").toString():"");
			   ProdClassdata_row.createCell(4).setCellValue(ProdClassresult.get("ENG_NAME")!=null?ProdClassresult.get("ENG_NAME").toString():"");
			   ProdClassdata_row.createCell(5).setCellValue(ProdClassresult.get("PY_NAME")!=null?ProdClassresult.get("PY_NAME").toString():"");
			   ProdClassdata_row.createCell(6).setCellValue(ProdClassresult.get("BX_NAME")!=null?ProdClassresult.get("BX_NAME").toString():"");
			   ProdClassdata_row.createCell(7).setCellValue(ProdClassresult.get("NOTE")!=null?ProdClassresult.get("NOTE").toString():"");
			   ProdClassdata_row.createCell(8).setCellValue(ProdClassresult.get("NAME")!=null?ProdClassresult.get("NAME").toString():"");
			   ProdClassdata_row.createCell(9).setCellValue(ProdClassresult.get("TYPE")!=null?ProdClassresult.get("TYPE").toString():"");		
			   ProdClassdata_row.createCell(10).setCellValue(ProdClassresult.get("STATUS")!=null?ProdClassresult.get("STATUS").toString():"");
			   ProdClassdata_row.createCell(11).setCellValue(ProdClassresult.get("CODE")!=null?ProdClassresult.get("CODE").toString():"");
				}
				workbook.write(fos3);
				srcfile.add(new File(path + folder + "\\ProdClass"+(k3+1)+"-"+last3+".dbf"));
				response.flushBuffer();
				fos3.close();
				this.addActionMessage("导出ProdClass完成");
			}
			}
			/**
				 *  ManageRegion导出
				 */	
			FileOutputStream fos4 = null;
		    queryMap.put("regionCode", query_cityCode);
    	    queryMap.put("name", query_cityName);
			ManageRegionresultList = manageRegionService
					.ManageRegionexcel(queryMap);
			int ManageRegionsize = ManageRegionresultList.size();
			if (ManageRegionsize ==0) {
				this.addActionError("** ManageRegionsize无数据 !");
				ManageRegionisnull = true;
			}else{
			int count4 = (int) Math.ceil((ManageRegionsize / num) + 1);
			int i4;
			int k4 = 0 + (pagenum - 1) * num;
			int last4;
			if(pagenum==count4){
				last4=ManageRegionsize;
			}else {
				last4=num*pagenum;
			}
			if (pagenum > count4) {
				this.addActionError("** ManageRegion此页无数据 !");
				ManageRegionisnull = true;
			} else {
			fos4 = new FileOutputStream(path+folder+"\\ManageRegion"+(k4+1)+"-"+last4+".dbf");
			HSSFWorkbook workbook = new HSSFWorkbook();	
			HSSFSheet ManageRegionsheet = workbook.createSheet("ManageRegion");	
			ManageRegionsheet.setDefaultColumnWidth(15);
			HSSFRow ManageRegionrow = ManageRegionsheet.createRow(0);					 
			ManageRegionrow.createCell(0).setCellValue("地区代码 ");	
			ManageRegionrow.createCell(1).setCellValue("短名称 ");
			ManageRegionrow.createCell(2).setCellValue("英文名 ");
			ManageRegionrow.createCell(3).setCellValue("电话位数 ");
			ManageRegionrow.createCell(4).setCellValue("区号 ");
			ManageRegionrow.createCell(5).setCellValue("简称 ");
			ManageRegionrow.createCell(6).setCellValue("备注 ");
			ManageRegionrow.createCell(7).setCellValue("名称 ");
			int r4=0;
			for ( i4 = k4; i4 < ManageRegionresultList.size()&&i4<k4+num; i4++,r4++) {					
				HSSFRow ManageRegiondata_row = ManageRegionsheet.createRow(r4+1);			
			   Map ManageRegionresult = (Map)ManageRegionresultList.get(i4);	 		 
			   ManageRegiondata_row.createCell(0).setCellValue(ManageRegionresult.get("REGION_CODE")!=null?ManageRegionresult.get("REGION_CODE").toString():"");					
			   ManageRegiondata_row.createCell(1).setCellValue(ManageRegionresult.get("SHORT_NAME")!=null?ManageRegionresult.get("SHORT_NAME").toString():"");
			   ManageRegiondata_row.createCell(2).setCellValue(ManageRegionresult.get("ENG_NAME")!=null?ManageRegionresult.get("ENG_NAME").toString():"");
			   ManageRegiondata_row.createCell(3).setCellValue(ManageRegionresult.get("TEL_LENGTH")!=null?ManageRegionresult.get("TEL_LENGTH").toString():"");
			   ManageRegiondata_row.createCell(4).setCellValue(ManageRegionresult.get("AREA_CODE")!=null?ManageRegionresult.get("AREA_CODE").toString():"");
			   ManageRegiondata_row.createCell(5).setCellValue(ManageRegionresult.get("ABBR_NAME")!=null?ManageRegionresult.get("ABBR_NAME").toString():"");
			   ManageRegiondata_row.createCell(6).setCellValue(ManageRegionresult.get("NOTE")!=null?ManageRegionresult.get("NOTE").toString():"");
			   ManageRegiondata_row.createCell(7).setCellValue(ManageRegionresult.get("NAME")!=null?ManageRegionresult.get("NAME").toString():"");
				}	
				workbook.write(fos4);
				srcfile.add(new File(path + folder + "\\ManageRegion"+(k4+1)+"-"+last4+".dbf"));
				response.flushBuffer();
				fos4.close();
				this.addActionMessage("导出ManageRegion完成");
			}
			}
			if (ProdCustomerisnull == true && ProdGroupisnull == true
					& ProdClassisnull == true & ManageRegionisnull == true) {
				todownloaddbf = "";
				this.addActionMessage("请重新导出数据");
			} else {
				todownloaddbf = "";
				File zipfile = new File(path + folder + ".zip");
				this.zipFiles(srcfile, zipfile);
				todownloaddbf = "window.open('db_ndc_dbf.zip');";
			}
		} catch (Exception e) {
				log.error(e.getMessage(), e);
				this.addActionError("** 生成文件错误 !");
				
			} finally {
				if (fos != null) {
					try {
						//outp.close();
						fos.close();

					} catch (IOException e) {
						log.error(e.getMessage(), e);
					}
				}
			}	
			
			return RESULT_QUERY;
		}	
	
	public String downloadexcel(){
		HttpServletRequest request = ServletActionContext.getRequest();
		HttpServletResponse response = ServletActionContext.getResponse();
		response.setContentType("text/html;charset=GBK ");
		String path = request.getSession().getServletContext().getRealPath("");
		path = path.replace("\\", "//");
		String folder = "//db_ndc_excel";
		File file = new File(path + "\\db_ndc_excel.zip");
		File file2 = new File(path + folder);
		todownload = "";
		if (file.exists()) {
			todownload = "window.open('db_ndc_excel.zip');";
		} else {
			todownload = "";
			message = "请先导出excel数据！";
		}
		todownload = "";
		file.delete();

		if (file2.exists() && file2.isDirectory()) {
			if (file2.listFiles().length == 0) {
				file2.delete();
			} else {
				File delFile[] = file2.listFiles();
				int i = file2.listFiles().length;
				for (int j = 0; j < i; j++) {
					if (delFile[j].isDirectory()) {
						del(delFile[j].getAbsolutePath());
					}
					delFile[j].delete();
				}
			}
		} 		
		return RESULT_QUERY;
	}
	private void del(String absolutePath) {
		// TODO Auto-generated method stub		
	}

	public String downloadcsv(){
		HttpServletRequest request = ServletActionContext.getRequest();
		HttpServletResponse response = ServletActionContext.getResponse();
		response.setContentType("text/html;charset=GBK ");
		String path = request.getSession().getServletContext().getRealPath("");
		path = path.replace("\\", "//");
		File file = new File(path + "\\db_ndc_csv.zip");
		String folder = "//db_ndc_csv";
		File file2 = new File(path + folder);
		todownloadcsv = "";
		if (file.exists()) {
			todownloadcsv = "window.open('db_ndc_csv.zip');";
		} else {
			todownloadcsv = "";
			message = "请先导出csv数据！";
		}
		todownloadcsv = "";
		file.delete();
		if (file2.exists() && file2.isDirectory()) {
			if (file2.listFiles().length == 0) {
				file2.delete();
			} else {
				File delFile[] = file2.listFiles();
				int i = file2.listFiles().length;
				for (int j = 0; j < i; j++) {
					if (delFile[j].isDirectory()) {
						del(delFile[j].getAbsolutePath());
					}
					delFile[j].delete();
				}
			}
		}
		return RESULT_QUERY;
	}
	
	public String downloaddbf() {
		HttpServletRequest request = ServletActionContext.getRequest();
		HttpServletResponse response = ServletActionContext.getResponse();
		response.setContentType("text/html;charset=GBK ");
		String path = request.getSession().getServletContext().getRealPath("");
		path = path.replace("\\", "//");
		File file = new File(path + "\\db_ndc_dbf.zip");
		String folder = "//db_ndc_dbf";
		File file2 = new File(path + folder);
		todownloaddbf = "";
		if (file.exists()) {
			todownloaddbf = "window.open('db_ndc_dbf.zip');";
		} else {
			todownloaddbf = "";
			message = "请先导出dbf数据！";
		}
		todownloaddbf = "";
		file.delete();
		if (file2.exists() && file2.isDirectory()) {
			if (file2.listFiles().length == 0) {
				file2.delete();
			} else {
				File delFile[] = file2.listFiles();
				int i = file2.listFiles().length;
				for (int j = 0; j < i; j++) {
					if (delFile[j].isDirectory()) {
						del(delFile[j].getAbsolutePath());
					}
					delFile[j].delete();
				}
			}
		}
		return RESULT_QUERY;
	}
	
	
	
	
	/**
	 * getters and setters
	 * 
	 * @return
	 */
	public void setProdCustomer(ProdCustomer prodCustomer) {
		this.prodCustomer = prodCustomer;
	}

	public ProdCustomer getProdCustomer() {
		return prodCustomer;
	}

	public void setProdCustomerService(ProdCustomerService prodCustomerService) {
		this.prodCustomerService = prodCustomerService;
	}

	public List<ProdCustomer> getProdCustomerList() {
		return prodCustomerList;
	}

	public void setProdCustomerList(List<ProdCustomer> prodCustomerList) {
		this.prodCustomerList = prodCustomerList;
	}

	public String getSelectedId() {
		return selectedId;
	}

	public void setSelectedId(String selectedId) {
		this.selectedId = selectedId;
	}

	public String[] getSelectedIds() {
		return selectedIds;
	}

	public void setSelectedIds(String[] selectedIds) {
		this.selectedIds = selectedIds;
	}

	public String getMessage() {
		return message;
	}

	public void setMessage(String message) {
		this.message = message;
	}

	public List<Map> getResultList() {
		return resultList;
	}

	public void setResultList(List<Map> resultList) {
		this.resultList = resultList;
	}

	public String getQuery_prodClassCode1() {
		return this.query_prodClassCode1;
	}

	public void setQuery_prodClassCode1(String prodClassCode1) {
		this.query_prodClassCode1 = prodClassCode1;
	}

	public String getQuery_prodClassName1() {
		return this.query_prodClassName1;
	}

	public void setQuery_prodClassName1(String prodClassName1) {
		this.query_prodClassName1 = prodClassName1;
	}

	public String getQuery_prodClassCode2() {
		return this.query_prodClassCode2;
	}

	public void setQuery_prodClassCode2(String prodClassCode2) {
		this.query_prodClassCode2 = prodClassCode2;
	}

	public String getQuery_prodClassName2() {
		return this.query_prodClassName2;
	}

	public void setQuery_prodClassName2(String prodClassName2) {
		this.query_prodClassName2 = prodClassName2;
	}

	public String getQuery_custId() {
		return this.query_custId;
	}

	public void setQuery_custId(String custId) {
		this.query_custId = custId;
	}

	public String getQuery_groupId() {
		return this.query_groupId;
	}

	public void setQuery_groupId(String groupId) {
		this.query_groupId = groupId;
	}

	public String getQuery_name1() {
		return this.query_name1;
	}

	public void setQuery_name1(String name1) {
		this.query_name1 = name1;
	}

	public String getQuery_name2() {
		return this.query_name2;
	}

	public void setQuery_name2(String name2) {
		this.query_name2 = name2;
	}

	public String getQuery_subname1() {
		return this.query_subname1;
	}

	public void setQuery_subname1(String subname1) {
		this.query_subname1 = subname1;
	}

	public String getQuery_subname2() {
		return this.query_subname2;
	}

	public void setQuery_subname2(String subname2) {
		this.query_subname2 = subname2;
	}

	public String getQuery_subname3() {
		return this.query_subname3;
	}

	public void setQuery_subname3(String subname3) {
		this.query_subname3 = subname3;
	}

	public String getQuery_subname4() {
		return this.query_subname4;
	}

	public void setQuery_subname4(String subname4) {
		this.query_subname4 = subname4;
	}

	public String getQuery_tel() {
		return this.query_tel;
	}

	public void setQuery_tel(String tel) {
		this.query_tel = tel;
	}

	public String getQuery_telExt() {
		return this.query_telExt;
	}

	public void setQuery_telExt(String telExt) {
		this.query_telExt = telExt;
	}

	public String getQuery_faxFlag() {
		return this.query_faxFlag;
	}

	public void setQuery_faxFlag(String faxFlag) {
		this.query_faxFlag = faxFlag;
	}

	public String getQuery_sb() {
		return this.query_sb;
	}

	public void setQuery_sb(String sb) {
		this.query_sb = sb;
	}

	public String getQuery_listOrder() {
		return this.query_listOrder;
	}

	public void setQuery_listOrder(String listOrder) {
		this.query_listOrder = listOrder;
	}

	public String getQuery_regionCode() {
		return this.query_regionCode;
	}

	public void setQuery_regionCode(String regionCode) {
		this.query_regionCode = regionCode;
	}

	public String getQuery_regionName() {
		return this.query_regionName;
	}

	public void setQuery_regionName(String regionName) {
		this.query_regionName = regionName;
	}

	public String getQuery_cityCode() {
		return this.query_cityCode;
	}

	public void setQuery_cityCode(String cityCode) {
		this.query_cityCode = cityCode;
	}

	public String getQuery_cityName() {
		return this.query_cityName;
	}

	public void setQuery_cityName(String cityName) {
		this.query_cityName = cityName;
	}

	public String getQuery_destrictCode() {
		return this.query_destrictCode;
	}

	public void setQuery_destrictCode(String destrictCode) {
		this.query_destrictCode = destrictCode;
	}

	public String getQuery_destrictName() {
		return this.query_destrictName;
	}

	public void setQuery_destrictName(String destrictName) {
		this.query_destrictName = destrictName;
	}

	public String getQuery_areaCode() {
		return this.query_areaCode;
	}

	public void setQuery_areaCode(String areaCode) {
		this.query_areaCode = areaCode;
	}

	public String getQuery_addr() {
		return this.query_addr;
	}

	public void setQuery_addr(String addr) {
		this.query_addr = addr;
	}

	public String getQuery_zip() {
		return this.query_zip;
	}

	public void setQuery_zip(String zip) {
		this.query_zip = zip;
	}

	public String getQuery_pyAddr() {
		return this.query_pyAddr;
	}

	public void setQuery_pyAddr(String pyAddr) {
		this.query_pyAddr = pyAddr;
	}

	public String getQuery_engAddr() {
		return this.query_engAddr;
	}

	public void setQuery_engAddr(String engAddr) {
		this.query_engAddr = engAddr;
	}

	public String getQuery_poix() {
		return this.query_poix;
	}

	public void setQuery_poix(String poix) {
		this.query_poix = poix;
	}

	public String getQuery_poiy() {
		return this.query_poiy;
	}

	public void setQuery_poiy(String poiy) {
		this.query_poiy = poiy;
	}

	public String getQuery_custStatus() {
		return this.query_custStatus;
	}

	public void setQuery_custStatus(String custStatus) {
		this.query_custStatus = custStatus;
	}

	public String getQuery_custTypeCode() {
		return this.query_custTypeCode;
	}

	public void setQuery_custTypeCode(String custTypeCode) {
		this.query_custTypeCode = custTypeCode;
	}

	public String getQuery_classMainId() {
		return this.query_classMainId;
	}

	public void setQuery_classMainId(String classMainId) {
		this.query_classMainId = classMainId;
	}

	public String getQuery_orgId() {
		return this.query_orgId;
	}

	public void setQuery_orgId(String orgId) {
		this.query_orgId = orgId;
	}

	public String getQuery_url() {
		return this.query_url;
	}

	public void setQuery_url(String url) {
		this.query_url = url;
	}

	public String getQuery_weibo() {
		return this.query_weibo;
	}

	public void setQuery_weibo(String weibo) {
		this.query_weibo = weibo;
	}

	public String getQuery_weixin() {
		return this.query_weixin;
	}

	public void setQuery_weixin(String weixin) {
		this.query_weixin = weixin;
	}

	public String getQuery_yixin() {
		return this.query_yixin;
	}

	public void setQuery_yixin(String yixin) {
		this.query_yixin = yixin;
	}

	public String getQuery_logo() {
		return this.query_logo;
	}

	public void setQuery_logo(String logo) {
		this.query_logo = logo;
	}

	public String getQuery_safeStatus() {
		return this.query_safeStatus;
	}

	public void setQuery_safeStatus(String safeStatus) {
		this.query_safeStatus = safeStatus;
	}

	public String getQuery_bxName() {
		return this.query_bxName;
	}

	public void setQuery_bxName(String bxName) {
		this.query_bxName = bxName;
	}

	public String getQuery_pyName() {
		return this.query_pyName;
	}

	public void setQuery_pyName(String pyName) {
		this.query_pyName = pyName;
	}

	public String getQuery_engName() {
		return this.query_engName;
	}

	public void setQuery_engName(String engName) {
		this.query_engName = engName;
	}

	public String getQuery_spName() {
		return this.query_spName;
	}

	public void setQuery_spName(String spName) {
		this.query_spName = spName;
	}

	public String getQuery_sourceId() {
		return this.query_sourceId;
	}

	public void setQuery_sourceId(String sourceId) {
		this.query_sourceId = sourceId;
	}

	public String getQuery_prodClassId() {
		return this.query_prodClassId;
	}

	public void setQuery_prodClassId(String prodClassId) {
		this.query_prodClassId = prodClassId;
	}

	public String getQuery_modifyTime() {
		return this.query_modifyTime;
	}

	public void setQuery_modifyTime(String modifyTime) {
		this.query_modifyTime = modifyTime;
	}

	public String getQuery_modifyEmpId() {
		return this.query_modifyEmpId;
	}

	public void setQuery_modifyEmpId(String modifyEmpId) {
		this.query_modifyEmpId = modifyEmpId;
	}

	public String getQuery_inputTime() {
		return this.query_inputTime;
	}

	public void setQuery_inputTime(String inputTime) {
		this.query_inputTime = inputTime;
	}

	public String getQuery_inputEmpId() {
		return this.query_inputEmpId;
	}

	public void setQuery_inputEmpId(String inputEmpId) {
		this.query_inputEmpId = inputEmpId;
	}

	public String getQuery_id() {
		return this.query_id;
	}

	public void setQuery_id(String id) {
		this.query_id = id;
	}

	public String getQuery_source() {
		return this.query_source;
	}

	public void setQuery_source(String source) {
		this.query_source = source;
	}

	public String getQuery_inputEmpCode() {
		return query_inputEmpCode;
	}

	public void setQuery_inputEmpCode(String queryInputEmpCode) {
		query_inputEmpCode = queryInputEmpCode;
	}

	public String getQuery_modifyEmpCode() {
		return query_modifyEmpCode;
	}

	public void setQuery_modifyEmpCode(String queryModifyEmpCode) {
		query_modifyEmpCode = queryModifyEmpCode;
	}
	
	public void setProdGroupService(ProdGroupService prodGroupService) {
		this.prodGroupService = prodGroupService;
	}

	

	public String getQuery_status114yp() {
		return query_status114yp;
	}

	public void setQuery_status114yp(String query_status114yp) {
		this.query_status114yp = query_status114yp;
	}

	public String getQuery_status360() {
		return query_status360;
	}

	public void setQuery_status360(String query_status360) {
		this.query_status360 = query_status360;
	}

	public String getAnyUpdateSelectId() {
		return anyUpdateSelectId;
	}

	public void setAnyUpdateSelectId(String anyUpdateSelectId) {
		this.anyUpdateSelectId = anyUpdateSelectId;
	}

	public String[] getSelectedUpdate() {
		return selectedUpdate;
	}

	public void setSelectedUpdate(String[] selectedUpdate) {
		this.selectedUpdate = selectedUpdate;
	}

	public List<Map> getProdGroupresultList() {
		return ProdGroupresultList;
	}

	public void setProdGroupresultList(List<Map> prodGroupresultList) {
		ProdGroupresultList = prodGroupresultList;
	}

	public List<Map> getProdClassresultList() {
		return ProdClassresultList;
	}

	public void setProdClassresultList(List<Map> prodClassresultList) {
		ProdClassresultList = prodClassresultList;
	}

	public ProdGroup getProdGroup() {
		return prodGroup;
	}

	public void setProdGroup(ProdGroup prodGroup) {
		this.prodGroup = prodGroup;
	}

	public ProdClass getProdClass() {
		return prodClass;
	}

	public void setProdClass(ProdClass prodClass) {
		this.prodClass = prodClass;
	}

	public ProdClassService getProdClassService() {
		return prodClassService;
	}

	public void setProdClassService(ProdClassService prodClassService) {
		this.prodClassService = prodClassService;
	}

	public ProdCustomerService getProdCustomerService() {
		return prodCustomerService;
	}

	public ProdGroupService getProdGroupService() {
		return prodGroupService;
	}

	public List<Map> getManageRegionresultList() {
		return ManageRegionresultList;
	}

	public void setManageRegionresultList(List<Map> manageRegionresultList) {
		ManageRegionresultList = manageRegionresultList;
	}

	public ManageRegion getManageRegion() {
		return manageRegion;
	}

	public void setManageRegion(ManageRegion manageRegion) {
		this.manageRegion = manageRegion;
	}

	public ManageRegionService getManageRegionService() {
		return manageRegionService;
	}

	public void setManageRegionService(ManageRegionService manageRegionService) {
		this.manageRegionService = manageRegionService;
	}

	public String getProdgroup_prodClassCode1() {
		return prodgroup_prodClassCode1;
	}

	public void setProdgroup_prodClassCode1(String prodgroup_prodClassCode1) {
		this.prodgroup_prodClassCode1 = prodgroup_prodClassCode1;
	}

	public String getProdgroup_prodClassName1() {
		return prodgroup_prodClassName1;
	}

	public void setProdgroup_prodClassName1(String prodgroup_prodClassName1) {
		this.prodgroup_prodClassName1 = prodgroup_prodClassName1;
	}

	public String getProdgroup_prodClassCode2() {
		return prodgroup_prodClassCode2;
	}

	public void setProdgroup_prodClassCode2(String prodgroup_prodClassCode2) {
		this.prodgroup_prodClassCode2 = prodgroup_prodClassCode2;
	}

	public String getProdgroup_prodClassName2() {
		return prodgroup_prodClassName2;
	}

	public void setProdgroup_prodClassName2(String prodgroup_prodClassName2) {
		this.prodgroup_prodClassName2 = prodgroup_prodClassName2;
	}

	public String getProdgroup_groupId() {
		return prodgroup_groupId;
	}

	public void setProdgroup_groupId(String prodgroup_groupId) {
		this.prodgroup_groupId = prodgroup_groupId;
	}

	public String getProdgroup_name1() {
		return prodgroup_name1;
	}

	public void setProdgroup_name1(String prodgroup_name1) {
		this.prodgroup_name1 = prodgroup_name1;
	}

	public String getProdgroup_name2() {
		return prodgroup_name2;
	}

	public void setProdgroup_name2(String prodgroup_name2) {
		this.prodgroup_name2 = prodgroup_name2;
	}

	public String getProdgroup_subname1() {
		return prodgroup_subname1;
	}

	public void setProdgroup_subname1(String prodgroup_subname1) {
		this.prodgroup_subname1 = prodgroup_subname1;
	}

	public String getProdgroup_subname2() {
		return prodgroup_subname2;
	}

	public void setProdgroup_subname2(String prodgroup_subname2) {
		this.prodgroup_subname2 = prodgroup_subname2;
	}

	public String getProdgroup_subname3() {
		return prodgroup_subname3;
	}

	public void setProdgroup_subname3(String prodgroup_subname3) {
		this.prodgroup_subname3 = prodgroup_subname3;
	}

	public String getProdgroup_subname4() {
		return prodgroup_subname4;
	}

	public void setProdgroup_subname4(String prodgroup_subname4) {
		this.prodgroup_subname4 = prodgroup_subname4;
	}

	public String getProdgroup_tel() {
		return prodgroup_tel;
	}

	public void setProdgroup_tel(String prodgroup_tel) {
		this.prodgroup_tel = prodgroup_tel;
	}

	public String getProdgroup_telExt() {
		return prodgroup_telExt;
	}

	public void setProdgroup_telExt(String prodgroup_telExt) {
		this.prodgroup_telExt = prodgroup_telExt;
	}

	public String getProdgroup_faxFlag() {
		return prodgroup_faxFlag;
	}

	public void setProdgroup_faxFlag(String prodgroup_faxFlag) {
		this.prodgroup_faxFlag = prodgroup_faxFlag;
	}

	public String getProdgroup_sb() {
		return prodgroup_sb;
	}

	public void setProdgroup_sb(String prodgroup_sb) {
		this.prodgroup_sb = prodgroup_sb;
	}

	public String getProdgroup_listOrder() {
		return prodgroup_listOrder;
	}

	public void setProdgroup_listOrder(String prodgroup_listOrder) {
		this.prodgroup_listOrder = prodgroup_listOrder;
	}

	public String getProdgroup_regionCode() {
		return prodgroup_regionCode;
	}

	public void setProdgroup_regionCode(String prodgroup_regionCode) {
		this.prodgroup_regionCode = prodgroup_regionCode;
	}

	public String getProdgroup_regionName() {
		return prodgroup_regionName;
	}

	public void setProdgroup_regionName(String prodgroup_regionName) {
		this.prodgroup_regionName = prodgroup_regionName;
	}

	public String getProdgroup_cityCode() {
		return prodgroup_cityCode;
	}

	public void setProdgroup_cityCode(String prodgroup_cityCode) {
		this.prodgroup_cityCode = prodgroup_cityCode;
	}

	public String getProdgroup_cityName() {
		return prodgroup_cityName;
	}

	public void setProdgroup_cityName(String prodgroup_cityName) {
		this.prodgroup_cityName = prodgroup_cityName;
	}

	public String getProdgroup_destrictCode() {
		return prodgroup_destrictCode;
	}

	public void setProdgroup_destrictCode(String prodgroup_destrictCode) {
		this.prodgroup_destrictCode = prodgroup_destrictCode;
	}

	public String getProdgroup_destrictName() {
		return prodgroup_destrictName;
	}

	public void setProdgroup_destrictName(String prodgroup_destrictName) {
		this.prodgroup_destrictName = prodgroup_destrictName;
	}

	public String getProdgroup_areaCode() {
		return prodgroup_areaCode;
	}

	public void setProdgroup_areaCode(String prodgroup_areaCode) {
		this.prodgroup_areaCode = prodgroup_areaCode;
	}

	public String getProdgroup_addr() {
		return prodgroup_addr;
	}

	public void setProdgroup_addr(String prodgroup_addr) {
		this.prodgroup_addr = prodgroup_addr;
	}

	public String getProdgroup_zip() {
		return prodgroup_zip;
	}

	public void setProdgroup_zip(String prodgroup_zip) {
		this.prodgroup_zip = prodgroup_zip;
	}

	public String getProdgroup_pyAddr() {
		return prodgroup_pyAddr;
	}

	public void setProdgroup_pyAddr(String prodgroup_pyAddr) {
		this.prodgroup_pyAddr = prodgroup_pyAddr;
	}

	public String getProdgroup_engAddr() {
		return prodgroup_engAddr;
	}

	public void setProdgroup_engAddr(String prodgroup_engAddr) {
		this.prodgroup_engAddr = prodgroup_engAddr;
	}

	public String getProdgroup_poix() {
		return prodgroup_poix;
	}

	public void setProdgroup_poix(String prodgroup_poix) {
		this.prodgroup_poix = prodgroup_poix;
	}

	public String getProdgroup_poiy() {
		return prodgroup_poiy;
	}

	public void setProdgroup_poiy(String prodgroup_poiy) {
		this.prodgroup_poiy = prodgroup_poiy;
	}

	public String getProdgroup_custStatus() {
		return prodgroup_custStatus;
	}

	public void setProdgroup_custStatus(String prodgroup_custStatus) {
		this.prodgroup_custStatus = prodgroup_custStatus;
	}

	public String getProdgroup_custTypeCode() {
		return prodgroup_custTypeCode;
	}

	public void setProdgroup_custTypeCode(String prodgroup_custTypeCode) {
		this.prodgroup_custTypeCode = prodgroup_custTypeCode;
	}

	public String getProdgroup_classMainId() {
		return prodgroup_classMainId;
	}

	public void setProdgroup_classMainId(String prodgroup_classMainId) {
		this.prodgroup_classMainId = prodgroup_classMainId;
	}

	public String getProdgroup_orgId() {
		return prodgroup_orgId;
	}

	public void setProdgroup_orgId(String prodgroup_orgId) {
		this.prodgroup_orgId = prodgroup_orgId;
	}

	public String getProdgroup_url() {
		return prodgroup_url;
	}

	public void setProdgroup_url(String prodgroup_url) {
		this.prodgroup_url = prodgroup_url;
	}

	public String getProdgroup_weibo() {
		return prodgroup_weibo;
	}

	public void setProdgroup_weibo(String prodgroup_weibo) {
		this.prodgroup_weibo = prodgroup_weibo;
	}

	public String getProdgroup_weiboName() {
		return prodgroup_weiboName;
	}

	public void setProdgroup_weiboName(String prodgroup_weiboName) {
		this.prodgroup_weiboName = prodgroup_weiboName;
	}

	public String getProdgroup_weixin() {
		return prodgroup_weixin;
	}

	public void setProdgroup_weixin(String prodgroup_weixin) {
		this.prodgroup_weixin = prodgroup_weixin;
	}

	public String getProdgroup_yixin() {
		return prodgroup_yixin;
	}

	public void setProdgroup_yixin(String prodgroup_yixin) {
		this.prodgroup_yixin = prodgroup_yixin;
	}

	public String getProdgroup_logo() {
		return prodgroup_logo;
	}

	public void setProdgroup_logo(String prodgroup_logo) {
		this.prodgroup_logo = prodgroup_logo;
	}

	public String getProdgroup_safeStatus() {
		return prodgroup_safeStatus;
	}

	public void setProdgroup_safeStatus(String prodgroup_safeStatus) {
		this.prodgroup_safeStatus = prodgroup_safeStatus;
	}

	public String getProdgroup_bxName() {
		return prodgroup_bxName;
	}

	public void setProdgroup_bxName(String prodgroup_bxName) {
		this.prodgroup_bxName = prodgroup_bxName;
	}

	public String getProdgroup_pyName() {
		return prodgroup_pyName;
	}

	public void setProdgroup_pyName(String prodgroup_pyName) {
		this.prodgroup_pyName = prodgroup_pyName;
	}

	public String getProdgroup_engName() {
		return prodgroup_engName;
	}

	public void setProdgroup_engName(String prodgroup_engName) {
		this.prodgroup_engName = prodgroup_engName;
	}

	public String getProdgroup_spName() {
		return prodgroup_spName;
	}

	public void setProdgroup_spName(String prodgroup_spName) {
		this.prodgroup_spName = prodgroup_spName;
	}

	public String getProdgroup_prodClassId() {
		return prodgroup_prodClassId;
	}

	public void setProdgroup_prodClassId(String prodgroup_prodClassId) {
		this.prodgroup_prodClassId = prodgroup_prodClassId;
	}

	public String getProdgroup_modifyTime() {
		return prodgroup_modifyTime;
	}

	public void setProdgroup_modifyTime(String prodgroup_modifyTime) {
		this.prodgroup_modifyTime = prodgroup_modifyTime;
	}

	public String getProdgroup_modifyEmpId() {
		return prodgroup_modifyEmpId;
	}

	public void setProdgroup_modifyEmpId(String prodgroup_modifyEmpId) {
		this.prodgroup_modifyEmpId = prodgroup_modifyEmpId;
	}

	public String getProdgroup_inputTime() {
		return prodgroup_inputTime;
	}

	public void setProdgroup_inputTime(String prodgroup_inputTime) {
		this.prodgroup_inputTime = prodgroup_inputTime;
	}

	public String getProdgroup_inputEmpId() {
		return prodgroup_inputEmpId;
	}

	public void setProdgroup_inputEmpId(String prodgroup_inputEmpId) {
		this.prodgroup_inputEmpId = prodgroup_inputEmpId;
	}

	public String getProdgroup_id() {
		return prodgroup_id;
	}

	public void setProdgroup_id(String prodgroup_id) {
		this.prodgroup_id = prodgroup_id;
	}

	public String getProdgroup_inputEmpCode() {
		return prodgroup_inputEmpCode;
	}

	public void setProdgroup_inputEmpCode(String prodgroup_inputEmpCode) {
		this.prodgroup_inputEmpCode = prodgroup_inputEmpCode;
	}

	public String getProdgroup_modifyEmpCode() {
		return prodgroup_modifyEmpCode;
	}

	public void setProdgroup_modifyEmpCode(String prodgroup_modifyEmpCode) {
		this.prodgroup_modifyEmpCode = prodgroup_modifyEmpCode;
	}

	public String getProdclass_line() {
		return Prodclass_line;
	}

	public void setProdclass_line(String prodclass_line) {
		Prodclass_line = prodclass_line;
	}

	public String getProdclass_classId() {
		return Prodclass_classId;
	}

	public void setProdclass_classId(String prodclass_classId) {
		Prodclass_classId = prodclass_classId;
	}

	public String getProdclass_cityCode() {
		return Prodclass_cityCode;
	}

	public void setProdclass_cityCode(String prodclass_cityCode) {
		Prodclass_cityCode = prodclass_cityCode;
	}

	public String getProdclass_cityName() {
		return Prodclass_cityName;
	}

	public void setProdclass_cityName(String prodclass_cityName) {
		Prodclass_cityName = prodclass_cityName;
	}

	public String getProdclass_engName() {
		return Prodclass_engName;
	}

	public void setProdclass_engName(String prodclass_engName) {
		Prodclass_engName = prodclass_engName;
	}

	public String getProdclass_pyName() {
		return Prodclass_pyName;
	}

	public void setProdclass_pyName(String prodclass_pyName) {
		Prodclass_pyName = prodclass_pyName;
	}

	public String getProdclass_bxName() {
		return Prodclass_bxName;
	}

	public void setProdclass_bxName(String prodclass_bxName) {
		Prodclass_bxName = prodclass_bxName;
	}

	public String getProdclass_note() {
		return Prodclass_note;
	}

	public void setProdclass_note(String prodclass_note) {
		Prodclass_note = prodclass_note;
	}

	public String getProdclass_name() {
		return Prodclass_name;
	}

	public void setProdclass_name(String prodclass_name) {
		Prodclass_name = prodclass_name;
	}

	public String getProdclass_type() {
		return Prodclass_type;
	}

	public void setProdclass_type(String prodclass_type) {
		Prodclass_type = prodclass_type;
	}

	public String getProdclass_status() {
		return Prodclass_status;
	}

	public void setProdclass_status(String prodclass_status) {
		Prodclass_status = prodclass_status;
	}

	public String getProdclass_code() {
		return Prodclass_code;
	}

	public void setProdclass_code(String prodclass_code) {
		Prodclass_code = prodclass_code;
	}

	public String getProdclass_code1() {
		return Prodclass_code1;
	}

	public void setProdclass_code1(String prodclass_code1) {
		Prodclass_code1 = prodclass_code1;
	}

	public String getProdclass_name1() {
		return Prodclass_name1;
	}

	public void setProdclass_name1(String prodclass_name1) {
		Prodclass_name1 = prodclass_name1;
	}

	public String getProdclass_code2() {
		return Prodclass_code2;
	}

	public void setProdclass_code2(String prodclass_code2) {
		Prodclass_code2 = prodclass_code2;
	}

	public String getProdclass_name2() {
		return Prodclass_name2;
	}

	public void setProdclass_name2(String prodclass_name2) {
		Prodclass_name2 = prodclass_name2;
	}

	public String getManageRegion_regionCode() {
		return ManageRegion_regionCode;
	}

	public void setManageRegion_regionCode(String manageRegion_regionCode) {
		ManageRegion_regionCode = manageRegion_regionCode;
	}

	public String getManageRegion_shortName() {
		return ManageRegion_shortName;
	}

	public void setManageRegion_shortName(String manageRegion_shortName) {
		ManageRegion_shortName = manageRegion_shortName;
	}

	public String getManageRegion_engName() {
		return ManageRegion_engName;
	}

	public void setManageRegion_engName(String manageRegion_engName) {
		ManageRegion_engName = manageRegion_engName;
	}

	public String getManageRegion_telLength() {
		return ManageRegion_telLength;
	}

	public void setManageRegion_telLength(String manageRegion_telLength) {
		ManageRegion_telLength = manageRegion_telLength;
	}

	public String getManageRegion_areaCode() {
		return ManageRegion_areaCode;
	}

	public void setManageRegion_areaCode(String manageRegion_areaCode) {
		ManageRegion_areaCode = manageRegion_areaCode;
	}

	public String getManageRegion_abbrName() {
		return ManageRegion_abbrName;
	}

	public void setManageRegion_abbrName(String manageRegion_abbrName) {
		ManageRegion_abbrName = manageRegion_abbrName;
	}

	public String getManageRegion_note() {
		return ManageRegion_note;
	}

	public void setManageRegion_note(String manageRegion_note) {
		ManageRegion_note = manageRegion_note;
	}

	public String getManageRegion_name() {
		return ManageRegion_name;
	}

	public void setManageRegion_name(String manageRegion_name) {
		ManageRegion_name = manageRegion_name;
	}





	public String getTodownload() {
		return todownload;
	}





	public void setTodownload(String todownload) {
		this.todownload = todownload;
	}





	public String getTodownloadcsv() {
		return todownloadcsv;
	}





	public void setTodownloadcsv(String todownloadcsv) {
		this.todownloadcsv = todownloadcsv;
	}





	public String getTodownloaddbf() {
		return todownloaddbf;
	}





	public void setTodownloaddbf(String todownloaddbf) {
		this.todownloaddbf = todownloaddbf;
	}





	public int getNum() {
		return num;
	}





	public void setNum(int num) {
		this.num = num;
	}





	public int getPagenum() {
		return pagenum;
	}





	public void setPagenum(int pagenum) {
		this.pagenum = pagenum;
	}


	
	

	
}
